[gnome-shell] popupMenu: Make sure to disconnect open-state-changed when the menu item dies
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] popupMenu: Make sure to disconnect open-state-changed when the menu item dies
- Date: Tue, 6 Aug 2013 14:38:54 +0000 (UTC)
commit 41117578c5a6555aeb02663263ec476a8e3b2d82
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Aug 6 10:30:18 2013 -0400
popupMenu: Make sure to disconnect open-state-changed when the menu item dies
js/ui/popupMenu.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 57d9b49..fce1d2f 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -872,7 +872,11 @@ const PopupMenuBase = new Lang.Class({
// separator's adjacent siblings change visibility or position.
// open-state-changed isn't exactly that, but doing it in more
// precise ways would require a lot more bookkeeping.
- this.connect('open-state-changed', Lang.bind(this, function() {
this._updateSeparatorVisibility(menuItem); }));
+ let openStateChangeId = this.connect('open-state-changed', Lang.bind(this, function() {
this._updateSeparatorVisibility(menuItem); }));
+ let destroyId = menuItem.connect('destroy', Lang.bind(this, function() {
+ this.disconnect(openStateChangeId);
+ menuItem.disconnect(destroyId);
+ }));
} else if (menuItem instanceof PopupBaseMenuItem)
this._connectItemSignals(menuItem);
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]