[gnome-session] inhibitor: don't try to access inhibitor after it's vanished



commit bd7592dfb38dc2c3046e1c5cee2f70cfe65f9c13
Author: Ray Strode <rstrode redhat com>
Date:   Wed Mar 9 13:47:16 2016 -0500

    inhibitor: don't try to access inhibitor after it's vanished
    
    After we emit the vanished signal on the inhibitor it's likely
    to get freed, so don't try to use it from that point forward.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763169

 gnome-session/gsm-inhibitor.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnome-session/gsm-inhibitor.c b/gnome-session/gsm-inhibitor.c
index 3f02148..a9a1f42 100644
--- a/gnome-session/gsm-inhibitor.c
+++ b/gnome-session/gsm-inhibitor.c
@@ -250,9 +250,10 @@ on_inhibitor_vanished (GDBusConnection *connection,
 {
         GsmInhibitor  *inhibitor = user_data;
 
-        g_signal_emit (inhibitor, signals[VANISHED], 0);
-
         g_bus_unwatch_name (inhibitor->priv->watch_id);
+        inhibitor->priv->watch_id = 0;
+
+        g_signal_emit (inhibitor, signals[VANISHED], 0);
 }
 
 static void


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