[net-config] Add reference to gdbus connection 20/57320/1
authorSaurav Babu <saurav.babu@samsung.com>
Tue, 19 Jan 2016 04:14:26 +0000 (09:44 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Tue, 19 Jan 2016 04:14:26 +0000 (09:44 +0530)
When notify_func of g_dbus_connection_call() is called then gdbus
connection is unref'd. This patch adds a reference to gdbus connection
when notify_func of g_dbus_connection_call() is not NULL.

Change-Id: I1acd3db727ace790bde3a6e438bbc102541da2c7
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/dbus/netdbus.c

index d998fb7..33fa8cf 100755 (executable)
@@ -192,6 +192,8 @@ gboolean netconfig_invoke_dbus_method_nonblock(const char *dest, const char *pat
                        netdbus_get_cancellable(),
                        (GAsyncReadyCallback) notify_func,
                        NULL);
+       if (notify_func)
+               netconfig_gdbus_pending_call_ref();
 
        return TRUE;
 }