Skip to main content

Search and Top Navigation

#5005 closed bug (fixed)

Opened December 14, 2009 01:41PM UTC

Closed January 07, 2010 03:56AM UTC

Widget factory does not clean up event bindings

Reported by: scottgonzalez Owned by: scottgonzalez
Priority: blocker Milestone: 1.8
Component: ui.core Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

The base widget binds three event handlers, but does not unbind them on destroy. See jquery-ui-dev thread.

Attachments (0)
Change History (4)

Changed December 15, 2009 05:08AM UTC by thetoolman comment:1

Thank you Scott for reporting; here is my current workaround:

destroy: function() {

....

$.widget.prototype.destroy.apply(this, arguments); default destroy

see ticket; http://dev.jqueryui.com/ticket/5005

code fixes <= 1.7.2 ; expect bug will be fixed in 1.7.3

if($.ui.version <= "1.7.2") {

this.element.unbind("setData." + widgetName);

this.element.unbind("getData." + widgetName);

this.element.unbind("remove." + widgetName);

will remove all events sorry, might have other side effects?

this.element.unbind("remove");

}

},

Changed December 15, 2009 05:12AM UTC by thetoolman comment:2

The fix should be as easy as adding these lines to the widget destroy method (approx line 300 in ui.core.js):

this.element.unbind("setData." + name); 
this.element.unbind("getData." + name);
this.element.unbind("remove."  + name);

Changed December 28, 2009 03:52PM UTC by scottgonzalez comment:3

owner: → scott.gonzalez
status: newaccepted

Fixed in new widget factory in dev branch in r3544.

Changed January 07, 2010 03:56AM UTC by scottgonzalez comment:4

resolution: → fixed
status: acceptedclosed

Fixed in trunk in r3621 with merge.