[gnome-session/gnome-3-22] client: Prevent the GDBusMethodInvocation from being unref-ed twice



commit 22b42bbbac3d61a405bff4cdae9d8eb80353e443
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jun 29 17:10:25 2017 +0200

    client: Prevent the GDBusMethodInvocation from being unref-ed twice
    
    GsmExportedClientPrivate::handle-end-session-response, like every
    other gdbus-codegen-ed signal for handling methods on the server-side,
    expects a boolean return value from the callback. The lack of a return
    value might confuse the generated glue code into thinking that FALSE
    was returned and the call wasn't acknowledged. That inserts a call to
    g_dbus_method_invocation_return_error. Since we have already called
    g_dbus_method_invocation_return_value (via
    gsm_exported_client_private_complete_end_session_response), and both
    these methods drop GDBus' internal reference on the
    GDBusMethodInvocation we may up with a memory error.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784349

 gnome-session/gsm-dbus-client.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gnome-session/gsm-dbus-client.c b/gnome-session/gsm-dbus-client.c
index 6f5099f..dcf96f0 100644
--- a/gnome-session/gsm-dbus-client.c
+++ b/gnome-session/gsm-dbus-client.c
@@ -75,7 +75,7 @@ setup_connection (GsmDBusClient *client)
         return TRUE;
 }
 
-static void
+static gboolean
 handle_end_session_response (GsmExportedClientPrivate *skeleton,
                              GDBusMethodInvocation    *invocation,
                              gboolean                  is_ok,
@@ -87,6 +87,7 @@ handle_end_session_response (GsmExportedClientPrivate *skeleton,
                                          is_ok, FALSE, FALSE, reason);
 
         gsm_exported_client_private_complete_end_session_response (skeleton, invocation);
+        return TRUE;
 }
 
 static GObject *


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