Fix memory leak in stopObserving when it may keep a reference to watched elements forever (until page reload) #21

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@kir
Contributor
kir commented Jun 13, 2011

Hello,

The existing code of stopObserving doesn't cleanup CACHE variable which is used to cleanup all observers on page unload. Even if I detach all handlers from an element using stopObserving(), the CACHE variable will still have a reference to the element (and the whole tree).

The proposed patch fixes the problem.

Thanks,
KIR

@kir
Contributor
kir commented Jun 24, 2011

My original fix introduced a performance problem with stopObserving call. Now, this problem is fixed.

@savetheclocktower
Collaborator

I just merged my rewrite of dom.js and event.js — it fixes this problem. Thanks!

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