#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 15 years ago by
Milestone: | → 0.3release |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 15 years ago by
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?
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