Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute memory leak with nested properties #1676

Closed
dylanrtt opened this issue May 7, 2015 · 4 comments
Closed

Compute memory leak with nested properties #1676

dylanrtt opened this issue May 7, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@dylanrtt
Copy link
Contributor

dylanrtt commented May 7, 2015

Apparently if you manually add a compute to a Map, and the compute depends on a deep property of that same Map, it can leak bindings if used in conjunction with other event bindings in a certain order.

http://jsbin.com/nadelesulu/1/edit?html,js,console

@daffl daffl added this to the 2.2.6 milestone May 11, 2015
@daffl daffl added the bug label May 11, 2015
@justinbmeyer
Copy link
Contributor

This is likely due to can.Map thinking that compute represents a define.get.

@justinbmeyer justinbmeyer self-assigned this May 14, 2015
@justinbmeyer
Copy link
Contributor

Looked into this. First, I don't think you should be writing your code like this. There's no reason to bind to "change" events on can.Map anymore and you could use the define plugin to describe petInfo.

I'm not sure why you would set a compute as a property value of an attribute either.

All that being said, it would still be nice to make this work. The problem is that this code creates a "cycle" of binding that isn't being detected while unbinding.

@justinbmeyer
Copy link
Contributor

#1231 is probably related

@justinbmeyer
Copy link
Contributor

Closed by #1696.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants