[gnome-shell/gnome-3-16] ScreenShield: ensure we don't leak logind inhibitors



commit 0954efd875b92019a63be871408082ec01e43b7d
Author: Rui Matos <tiagomatos gmail com>
Date:   Mon May 11 15:59:24 2015 +0200

    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 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 1cfc211..d50113f 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;
                                    }));
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]