From 081d94e0f680578d4d53229c96aff83eff1fcbc2 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 21 Jan 2019 18:11:59 +0000 Subject: [PATCH] polkitAgent: Destroy session from dialogue closed handler Rather than explicitly destroying the session after calling close(), destroy it from the `closed` signal handler. This also means we can make the method internal. Signed-off-by: Philip Withnall https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/357 --- js/ui/components/polkitAgent.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index f03af35fc..7f38e122e 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -168,7 +168,7 @@ var AuthenticationDialog = new Lang.Class({ }, performAuthentication() { - this.destroySession(); + this._destroySession(); this._session = new PolkitAgent.Session({ identity: this._identityToAuth, cookie: this._cookie }); this._sessionCompletedId = this._session.connect('completed', this._onSessionCompleted.bind(this)); @@ -300,7 +300,7 @@ var AuthenticationDialog = new Lang.Class({ this._ensureOpen(); }, - destroySession() { + _destroySession() { if (this._session) { if (!this._completed) this._session.cancel(); @@ -331,6 +331,8 @@ var AuthenticationDialog = new Lang.Class({ if (this._sessionUpdatedId) Main.sessionMode.disconnect(this._sessionUpdatedId); this._sessionUpdatedId = 0; + + this._destroySession(); }, }); Signals.addSignalMethods(AuthenticationDialog.prototype); @@ -401,7 +403,6 @@ var AuthenticationAgent = new Lang.Class({ _completeRequest(dismissed) { this._currentDialog.close(); - this._currentDialog.destroySession(); this._currentDialog = null; if (this._sessionUpdatedId)