[gnome-session] shell: unref correct proxy on destroy



commit 15e263a678f733bb74601aa883b0830f8f0ac00c
Author: Ray Strode <rstrode redhat com>
Date:   Tue Oct 1 14:25:55 2013 -0400

    shell: unref correct proxy on destroy
    
    gsm-shell.c tries to automatically clear it's reference to the
    EndSessionDialog proxy when the proxy is destroyed.
    
    It accidentally unrefs the wrong object though.  This commit
    fixes that by changing the open coded unref+nullify to g_clear_object
    
    I believe this will address this crasher:
    
    https://retrace.fedoraproject.org/faf/problems/1214348/
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709221

 gnome-session/gsm-shell.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/gnome-session/gsm-shell.c b/gnome-session/gsm-shell.c
index 450ca40..1c7f053 100644
--- a/gnome-session/gsm-shell.c
+++ b/gnome-session/gsm-shell.c
@@ -534,11 +534,7 @@ static void
 on_end_session_dialog_proxy_destroyed (DBusGProxy *proxy,
                                        GsmShell   *shell)
 {
-        /* FIXME - is this right? */
-        if (shell->priv->end_session_dialog_proxy != NULL) {
-                g_object_unref (shell->priv->proxy);
-                shell->priv->end_session_dialog_proxy = NULL;
-        }
+        g_clear_object (&shell->priv->end_session_dialog_proxy);
 }
 
 static gboolean


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