From 7c9dbc66d9ab1f3adad29c827fac2d7d3ee05fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 21 Apr 2018 18:39:10 +0200 Subject: [PATCH] polkitAgent: Guard against repeated close() calls 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 --- js/ui/components/polkitAgent.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() {