mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
popupMenu: Make sure to disconnect open-state-changed when the menu item dies
This commit is contained in:
parent
a8ea6c2c66
commit
41117578c5
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue