-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Memory Leaks when dynamically loading #4419
Comments
@rid00z - Thanks for reporting. Mind creating a test page illustrating the issue? Template: http://jsbin.com/uqenom/edit |
Hi That should reproduce it. http://jsbin.com/uqenom/22/edit |
OK, so .empty() ends up calling _destroy() on widget instances that have this. We need to implement this for all widgets that attach global handlers. |
Yeh I ended up having to patch the widgets myself. It's working in my app, On Thursday, June 21, 2012, Gabriel |Nix| Schulhof wrote:
Michael Ridland | ThinkSmart Digital |
Thanks for the PR! There are a few more leaky places you could look at, if you'd like:
Fixing these should allow us to close this issue. |
The new widget factory has a |
... so instead of the problematic |
@rid00z - thanks for your help. If you'd like to help out, hop on #jquerymobile-dev on freenode and we'll find some uses for your talents. |
Saw this in the meeting notes: "the new widget factory has this._on() which nicely prevents memory leaks caused by stale attached event handlers, however, we should implement _destroy() on our widgets, because handlers attached to elements introduced during widget creation need not be removed if the elements are removed." - as long as you're using |
Our widgets need to implement |
Are there still widgets that don't clean up after themselves? If so, maybe individual tickets for each affected widget might help get this resolved. |
Yes, this is still work in progress. We have a generic ticket for adding the missing @arschmitz @gabrielschulhof - Can you open tickets for widgets that aren't done yet and close #5293? If this issue is completely resolved when all widgets have Thanks! Update: See See #5293 (comment). Closing this ticket as duplicate. Closing this ticket as duplicate. |
Found some JQuery Mobile widgets attach closures to the window and document object and JQuery Mobile was not cleaning them up.
So code below would result in a memory leak.
The text was updated successfully, but these errors were encountered: