Opened 12 years ago

Closed 12 years ago

#2793 closed defect (fixed)

widget destruction event memory leaks

Reported by: bill Owned by: bill
Priority: high Milestone: 0.9beta
Component: Widgets Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

When a widget is destroyed, need to call dojo.disconnect() on all the dojoAttachEvent things from the template. Not currently doing that (IIRC). Need to fix.

Change History (6)

comment:1 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

(In [8285]) Fix event cleanup on widget destruction.

Fixes #2793.

comment:2 Changed 12 years ago by bill

Resolution: fixed
Status: closedreopened

I'm opening this again; since cleanNodeEvents() was removed, there are marginal leak issues on IE6; I'm still struggling to understand the details but anyway I think it will make sense to keep an array of dojo.connect() handles to dojo.disconnect() on widget destroy.

(But be careful to remove entries from that array if you dojo.disconnect manually)

comment:3 Changed 12 years ago by bill

Resolution: fixed
Status: reopenedclosed

(In [8496]) Make _connects[] array to hold all connections a widget has made, and delete them on widget destruction. Add connect() method to Widget to do a dojo.connect() and save the returned handle in that array.

Fixes #2793.

comment:4 Changed 12 years ago by bill

(In [8531]) Refs #2793. But the mousewheel on safari seems to be broken, both before and after this change...

comment:5 Changed 12 years ago by guest

Resolution: fixed
Status: closedreopened

There are still event memory leaks. If you look at source:/dijit/trunk/Tree.js@10197#L390 for instance, there are 2 dojo.connect in that method that both will cause memory leaks. They are not saved an cannot be disconnected. Other files are source:/dijit/trunk/layout/StackContainer.js@10004#L293, but I have a feeling that there are many more.

Cameron Davison cameron.davison@…

comment:6 Changed 12 years ago by bill

Resolution: fixed
Status: reopenedclosed

Hi. I'm sure there are still lurking memory leaks, but as for the lines you've mentioned, they are connection to plain functions, not DOM nodes, so there's no memory leak there. (The tipoff is that the event name is camel-case, "onClick" rather than "onclick", so you know it's not a DOM node.

Note: See TracTickets for help on using tickets.