From 0954efd875b92019a63be871408082ec01e43b7d Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Mon, 11 May 2015 15:59:24 +0200 Subject: [PATCH] ScreenShield: ensure we don't leak logind inhibitors This could happen if we are VT switched away and an animated activation is requested because we're preparing to enter sleep. Since we don't animate in this case we'd never reach _completeLockScreenShown() before coming out of sleep, at which point we _inhibitSuspend() again and would leak the previous inhibitor. https://bugzilla.gnome.org/show_bug.cgi?id=749228 --- js/ui/screenShield.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 1cfc21177..d50113f88 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -667,6 +667,8 @@ const ScreenShield = new Lang.Class({ _inhibitSuspend: function() { this._loginManager.inhibit(_("GNOME needs to lock the screen"), Lang.bind(this, function(inhibitor) { + if (this._inhibitor) + this._inhibitor.close(null); this._inhibitor = inhibitor; })); },