Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#539 closed defect (invalid)

Cleanup of events for dynamically created widgets

Reported by: Michael Schall Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

if people are creating/destroying widgets dynamically then the dojoAttachEvent stuff (and manual dojo.event.connect() calls within the widget) should be cleaned up sooner than page unload (when destroy() is called).

Change History (3)

comment:1 Changed 14 years ago by alex

Milestone: 0.3release
Resolution: invalid
Status: newclosed

This is handled in destroyRendering (see HtmlWidget?.js) which is called from destroy(). Unless your widget is doing something outside of the domNode subtree which would require your own logic in an over-ridden destroyRendering, this should be a non-issue.

Regards

comment:2 Changed 14 years ago by bill

Hi Alex, just to confirm, if I have a double connection like this:

dojo.event.connect(a, "onclick", myFunc1); dojo.event.connect(a, "onclick", myFunc2);

then the code to call both myFunc1 and myFunc2 is attached to a? So when a goes away the events are automatically disconnected, right?

In any case, I suspect there are still corner cases where cleanup isn't getting done correctly; destroying a tooltip won't remove the onClick handler from the <div> that triggers the tooltip, will it?

comment:3 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.