diff options
author | Thomas Haller <thaller@redhat.com> | 2014-10-01 18:21:36 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-10-01 18:21:36 +0200 |
commit | 290cdfd372690f4b9d353394e260dcb3703d406a (patch) | |
tree | c5b169c14dc7b0fbfb6e16958bebd502065c829b | |
parent | 7462d9b69528a017500eb96f6affadbfcadadd1a (diff) | |
download | NetworkManager-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.c | 7 |
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; } |