summaryrefslogtreecommitdiff
path: root/src/nm-dbus-manager.c
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-04-23 11:39:34 +0200
committerDan Williams <dcbw@redhat.com>2013-05-03 10:50:33 -0500
commitfa9b295c0e809d146f2c118c5afd61c594047626 (patch)
tree1775f8517e75db01b79aaf8a43a8bbd125937371 /src/nm-dbus-manager.c
parent5f61594585b22cdb72ee5279de5a8d9e86b125cf (diff)
downloadNetworkManager-fa9b295c0e809d146f2c118c5afd61c594047626.tar.gz
core: close private D-BUS connections on disconnect (bgo #698640)
Private connections need to be closed in addition to being unrefed. https://bugzilla.gnome.org/show_bug.cgi?id=698640
Diffstat (limited to 'src/nm-dbus-manager.c')
-rw-r--r--src/nm-dbus-manager.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c
index 4953193e09..c8a2010fac 100644
--- a/src/nm-dbus-manager.c
+++ b/src/nm-dbus-manager.c
@@ -122,7 +122,6 @@ private_server_message_filter (DBusConnection *conn,
s->detail,
dbus_connection_get_g_connection (conn));
- dbus_connection_close (conn);
g_hash_table_remove (s->connections, conn);
/* Let dbus-glib process the message too */
@@ -167,6 +166,14 @@ private_server_new_connection (DBusServer *server,
dbus_connection_get_g_connection (conn));
}
+static void
+private_server_dbus_connection_destroy (DBusConnection *conn)
+{
+ if (dbus_connection_get_is_connected (conn))
+ dbus_connection_close (conn);
+ dbus_connection_unref (conn);
+}
+
static PrivateServer *
private_server_new (const char *path,
const char *tag,
@@ -198,7 +205,7 @@ private_server_new (const char *path,
dbus_server_set_new_connection_function (s->server, private_server_new_connection, s, NULL);
s->connections = g_hash_table_new_full (g_direct_hash, g_direct_equal,
- (GDestroyNotify) dbus_connection_unref,
+ (GDestroyNotify) private_server_dbus_connection_destroy,
g_free);
s->manager = manager;
s->tag = g_strdup (tag);