summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-10-01 18:21:36 +0200
committerThomas Haller <thaller@redhat.com>2014-10-01 18:21:36 +0200
commit290cdfd372690f4b9d353394e260dcb3703d406a (patch)
treec5b169c14dc7b0fbfb6e16958bebd502065c829b
parent7462d9b69528a017500eb96f6affadbfcadadd1a (diff)
downloadNetworkManager-th/bgo737725-libnm-private-dbus-connection.tar.gz
fixup! libnm: share private DBUS connectionth/bgo737725-libnm-private-dbus-connection
-rw-r--r--libnm/nm-dbus-helpers.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libnm/nm-dbus-helpers.c b/libnm/nm-dbus-helpers.c
index b551e80fbc..4c0318dd2e 100644
--- a/libnm/nm-dbus-helpers.c
+++ b/libnm/nm-dbus-helpers.c
@@ -77,10 +77,11 @@ _private_dbus_connection_internalize (GDBusConnection *connection)
p = g_weak_ref_get (&private_connection.weak_ref);
if (p) {
g_object_unref (connection);
- return p;
+ connection = p;
+ } else {
+ g_weak_ref_set (&private_connection.weak_ref, connection);
+ g_signal_connect (connection, "closed", G_CALLBACK (_private_dbus_connection_closed_cb), NULL);
}
- g_weak_ref_set (&private_connection.weak_ref, connection);
- g_signal_connect (connection, "closed", G_CALLBACK (_private_dbus_connection_closed_cb), NULL);
g_mutex_unlock (&private_connection.mutex);
return connection;
}