Opened 7 years ago

Closed 7 years ago

#16219 closed defect (invalid)

dijit/_WidgetBase inconsistent owning of handles

Reported by: ben hockey Owned by: ben hockey
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.8.1
Keywords: Cc:
Blocked By: Blocking:

Description

in dijit/_WidgetBase#on, calls where a widgetMethod exists are not owned but other calls are. this should probably be consistent and i'd say that owning all of them is probably the better option.

Change History (2)

comment:1 Changed 7 years ago by bill

Owner: changed from bill to ben hockey
Status: newpending

#16206 is similar. I'm not sure there's any point to this, since the advice will automatically be destroyed when the widget class (i.e. the javascript object) is destroyed, and there's no memory leak. What are your thoughts?

PS: If it's just for https://getfirebug.com/wiki/index.php/DojoFirebugExtension_Reference_Guide, I don't mind adding it, but I'm curious if there's any other issue.

Last edited 7 years ago by bill (previous) (diff)

comment:2 Changed 7 years ago by ben hockey

Resolution: invalid
Status: pendingclosed

i'm not too concerned about the firebug extension complaining. to be honest i've never looked at it.

from what i can tell, you're right that this doesn't leak - but that wasn't completely obvious/intuitive at first. when a widget is destroyed, the same general rules of garbage collection will apply (of course) but adding an aspect without removing it doesn't look like it will prevent garbage collection unless a reference to the handle is kept. the way the aspects work looks like the object being destroyed will maintain a reference to the listener function but if there are no more references to the object being destroyed, it doesn't matter that it references the listener, it can be garbage collected.

Note: See TracTickets for help on using tickets.