summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2018-04-21 18:39:10 +0200
committerFlorian Müllner <fmuellner@gnome.org>2018-04-21 18:42:15 +0200
commit0327069e83bc1ecedd909891e2a1f70df6269606 (patch)
treef03bf8c62e524e1eb098060004d846c42ad2938c
parent7601b029c8efd3a315dffe8b47aeb3526e8574bf (diff)
downloadgnome-shell-wip/fmuellner/221-repeated-polkit-close.tar.gz
polkitAgent: Guard against repeated close() callswip/fmuellner/221-repeated-polkit-close
We use the close() method to disconnect signal handlers set up in init(), however the handler ID is only valid in the first call in case the method is called more than once. https://gitlab.gnome.org/GNOME/gnome-shell/issues/221
-rw-r--r--js/ui/components/polkitAgent.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js
index 316bc2ad1..7a0682c4b 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -201,7 +201,9 @@ var AuthenticationDialog = new Lang.Class({
close(timestamp) {
this.parent(timestamp);
- Main.sessionMode.disconnect(this._sessionUpdatedId);
+ if (this._sessionUpdatedId)
+ Main.sessionMode.disconnect(this._sessionUpdatedId);
+ this._sessionUpdatedId = 0;
},
_ensureOpen() {