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
This commit is contained in:
Rui Matos 2015-05-11 15:59:24 +02:00
parent 8d913c5297
commit 0954efd875

View File

@ -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;
}));
},