IMStatusChooserItem: clean up signal handlers on destroy()

Extensions (like alternative-status-menu) expect that calling
destroy() on a menu item will not leave signal handlers around.

https://bugzilla.gnome.org/show_bug.cgi?id=660520
This commit is contained in:
Giovanni Campagna 2011-10-17 15:18:25 +02:00
parent de352a309d
commit 615723d8df

View File

@ -199,6 +199,21 @@ IMStatusChooserItem.prototype = {
})); }));
}, },
destroy: function() {
// clean up signal handlers
if (this._userLoadedId != 0) {
this._user.disconnect(this._userLoadedId);
this._userLoadedId = 0;
}
if (this._userChangedId != 0) {
this._user.disconnect(this._userChangedId);
this._userChangedId = 0;
}
PopupMenu.PopupBaseMenuItem.prototype.destroy.call(this);
},
// Override getColumnWidths()/setColumnWidths() to make the item // Override getColumnWidths()/setColumnWidths() to make the item
// independent from the overall column layout of the menu // independent from the overall column layout of the menu
getColumnWidths: function() { getColumnWidths: function() {