[gnome-games] ui: Check the inhibition cookie



commit f694588cf63786674fba583c72913ade8cb5ed42
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon May 8 11:33:39 2017 +0200

    ui: Check the inhibition cookie
    
    Check that the inhibition cookie isn't 0 before using it in
    ApplicationWindow.uninhibit(), this avoids a runtime error message.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781886

 src/ui/application-window.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 7e7e8a3..b533c10 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -540,7 +540,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                if ((bool) new_flags)
                        new_cookie = application.inhibit (this, new_flags, _("Playing a game"));
 
-               application.uninhibit (inhibit_cookie);
+               if (inhibit_cookie != 0)
+                       application.uninhibit (inhibit_cookie);
+
                inhibit_cookie = new_cookie;
                inhibit_flags = new_flags;
        }


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