[glib/glib-2-54] gopenuriportal: Fix mismatched types in callback



commit 692c8d179f6a68bfc65c5bb62979a1238c1ea99f
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Dec 18 19:05:57 2017 +0000

    gopenuriportal: Fix mismatched types in callback
    
    The source object for this asynchronous operation is the GXdpOpenURI,
    not a GDBusConnection. This was causing crashes in method calls on the
    connection, unsurprisingly.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791720

 gio/gopenuriportal.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gio/gopenuriportal.c b/gio/gopenuriportal.c
index 51a72df..247ed8c 100644
--- a/gio/gopenuriportal.c
+++ b/gio/gopenuriportal.c
@@ -197,7 +197,8 @@ open_call_done (GObject      *source,
                 GAsyncResult *result,
                 gpointer      user_data)
 {
-  GDBusConnection *connection = G_DBUS_CONNECTION (source);
+  GXdpOpenURI *openuri = GXDP_OPEN_URI (source);
+  GDBusConnection *connection;
   GTask *task = user_data;
   GError *error = NULL;
   gboolean open_file;
@@ -206,6 +207,7 @@ open_call_done (GObject      *source,
   const char *handle;
   guint signal_id;
 
+  connection = g_dbus_proxy_get_connection (G_DBUS_PROXY (openuri));
   open_file = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (task), "open-file"));
 
   if (open_file)


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