[gnome-shell] PopupMenu: disconnect from 'destroy' signals of destroyed items
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] PopupMenu: disconnect from 'destroy' signals of destroyed items
- Date: Thu, 22 Dec 2011 17:01:19 +0000 (UTC)
commit a7bd9f811b97580e6a227cb2d5958e1dfc31ceee
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Mon Dec 12 20:36:00 2011 +0100
PopupMenu: disconnect from 'destroy' signals of destroyed items
After an item is destroyed, all its signals were disconnected,
except for 'destroy' itself. This could lead to exceptions, if
destroy was called more than once on the item.
https://bugzilla.gnome.org/show_bug.cgi?id=665680
js/ui/popupMenu.js | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index c6dc3df..93ac2f3 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -939,7 +939,12 @@ const PopupMenuBase = new Lang.Class({
this.emit('activate', menuItem);
this.close(true);
}));
- menuItem.connect('destroy', Lang.bind(this, function(emitter) {
+ // the weird name is to avoid a conflict with some random property
+ // the menuItem may have, called destroyId
+ // (FIXME: in the future it may make sense to have container objects
+ // like PopupMenuManager does)
+ menuItem._popupMenuDestroyId = menuItem.connect('destroy', Lang.bind(this, function(menuItem) {
+ menuItem.disconnect(menuItem._popupMenuDestroyId);
menuItem.disconnect(menuItem._activateId);
menuItem.disconnect(menuItem._activeChangeId);
menuItem.disconnect(menuItem._sensitiveChangeId);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]