Opened 6 years ago

Last modified 6 years ago

#9358 open bug

Resizable: Memory leak when destroying

Reported by: lsching17 Owned by:
Priority: minor Milestone: none
Component: ui.resizable Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

i create a testcase and access a "dummyObject" by closure during "open" event.

http://jsbin.com/iqeyat/3

If event handlers are detached after "destroy", then the "dummyObject" should be inaccessible and be garbage-collected.

But chrome heapshot shows that the "dummyObject" is still accessible, and i suspect that the event handlers are not detached

https://forum.jquery.com/viewImage.do

Change History (6)

comment:1 Changed 6 years ago by tj.vantoll

Component: ui.coreui.resizable
Status: newopen
Summary: event handler of dialog are not detached when destroy?Resizable: Memory leak when destroying

I'm not exactly sure what's going on here but this appears to be a problem with resizable and not dialog. Hit create and then destroy and the dummyObject instance will not be garbage collected: http://jsbin.com/iqeyat/14/edit.

Isching17 do you know if Chrome's dev tools give you any help tracking down line numbers / variable names? Or is it just function names? On this example (http://jsbin.com/iqeyat/14/edit) _alsoResize is the only specific thing I see and I don't see anything suspicious in there: https://github.com/jquery/jquery-ui/blob/6df5c1a4ae738e591694e0fe2fa3bbb8b05f6b0a/ui/jquery.ui.resizable.js#L874.

Thanks.

comment:2 Changed 6 years ago by lsching17

i am not a chrome expert, but placing the mouse on the related object will show the related information

http://s3.postimg.org/fcwkfg7qr/line_number.png

comment:3 Changed 6 years ago by tj.vantoll

Ah yeah, I meant to say _renderAxis in my previous comment. Still confusing why that would be holding a reference since the instance is gone. That'll help though, thanks.

comment:4 Changed 6 years ago by lsching17

please delete

Last edited 6 years ago by lsching17 (previous) (diff)

comment:5 Changed 6 years ago by lsching17

I created a BAD patch for jquery-ui.js (1.10.3) and linkage seems fixed, but do not know whether the widgets are broken.

http://jsbin.com/iqeyat/18/ http://jsbin.com/iqeyat/17/

::diff removed::

Last edited 6 years ago by Scott González (previous) (diff)

comment:6 Changed 6 years ago by Scott González

@lsching17 If you'd like to propose a change, please sign our CLA and submit a pull request.

Note: See TracTickets for help on using tickets.