-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Memory leak in stopListening? #3453
Comments
A pull request #3049 is already open to address this issue. Although there seems to be no desire to merge it at this time. |
jridgewell
added a commit
to jridgewell/backbone
that referenced
this issue
Jan 22, 2015
jridgewell
added a commit
to jridgewell/backbone
that referenced
this issue
Jan 22, 2015
jridgewell
added a commit
to jridgewell/backbone
that referenced
this issue
Jan 23, 2015
jridgewell
added a commit
to jridgewell/backbone
that referenced
this issue
Jan 25, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
this issue is some what related to ticket #3226 but it's not the same. If you think they are feel free to close and reference that.
After the fix of #3226 there's still a leak. But this doesn't just apply to the listenToOnce. Take a look at the following example. (The example runs Backbone v1.1.2 but the master works the same way).
The problem is that if the
model
I'm listening to has a listener as well. Then theview.listeningTo
will not be cleaned up correctly.It is because of this line:
obj._events
isn't empty and therefore theview
will keep its reference to themodel
. Is this correct? In our project this causes problems since the object that is listened to will always have its own listeners and where usinglistenToOnce
so the references to the old objects will be kept "forever". But we might have to rethink our solution to workaround this issue?/Albin
The text was updated successfully, but these errors were encountered: