Skip to content

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

Closed
kir wants to merge 2 commits into
prototypejs:masterfrom
kir:master
Closed

Fix memory leak in stopObserving when it may keep a reference to watched elements forever (until page reload)#21
kir wants to merge 2 commits into
prototypejs:masterfrom
kir:master

Conversation

@kir

@kir kir commented Jun 13, 2011

Copy link
Copy Markdown
Contributor

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

kir commented Jun 24, 2011

Copy link
Copy Markdown
Contributor Author

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

@savetheclocktower

Copy link
Copy Markdown
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants