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

Computed, Proxy, and Observer properties are not removed if the the model property is reset #82

Open
uselessinfo opened this issue Mar 11, 2014 · 1 comment
Assignees

Comments

@uselessinfo
Copy link
Contributor

Calling the following code will result in a potential memory leak, and may cause some weird issues.

var otherModel = new OtherModel();
masseuseModel.set('foo', masseuse.ProxyProperty('bar', otherModel);

// Do some work
...

otherModel = new OtherModel();
masseuseModel.set('foo', masseuse.ProxyProperty('bar', otherModel);

We need to keep a dictionary of computed, observer, and proxy properties, and perform cleanup of listeners prior to setting the property to something else.

@uselessinfo uselessinfo self-assigned this Mar 11, 2014
@pajtai
Copy link
Member

pajtai commented Mar 11, 2014

This might make it worthwhile to turn computed properties to using listeners - as you had it previously - instead of hard coded callbacks, since that way cleaning up Proxies and Computeds could be done in the same way.

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

No branches or pull requests

2 participants