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
This commit is contained in:
Florian Müllner 2018-04-21 18:39:10 +02:00
parent 7601b029c8
commit 0327069e83

View File

@ -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() {