summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2015-09-08 18:12:28 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2015-09-09 10:13:20 +0200
commit8318672fe99773b0009cf68d291ce1f535309565 (patch)
tree1e66cf05556b3af9b447ee3f504606f10eb2f1ab
parent998ab889495c18c62766b62441d72a8bcd84e6ff (diff)
downloadNetworkManager-8318672fe99773b0009cf68d291ce1f535309565.tar.gz
core: fix file descriptor leak in bus manager
There's a bug [1] in GLib for which a GDBusConnection is marked as closed when the remote peer vanishes but its resources are not cleaned up. Work around the issue by explicitly closing the connection when remote_peer_vanished is TRUE. [1] https://bugzilla.gnome.org/show_bug.cgi?id=754730 https://bugzilla.redhat.com/show_bug.cgi?id=1260920
-rw-r--r--src/nm-bus-manager.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nm-bus-manager.c b/src/nm-bus-manager.c
index 5f528a6f0e..57d77aae48 100644
--- a/src/nm-bus-manager.c
+++ b/src/nm-bus-manager.c
@@ -131,6 +131,13 @@ private_server_closed (GDBusConnection *conn,
s->detail,
conn);
+ /* FIXME: there's a bug (754730) in GLib for which the connection
+ * is marked as closed when the remote peer vanishes but its
+ * resources are not cleaned up. Work around it by explicitly
+ * closing the connection in that case. */
+ if (remote_peer_vanished)
+ g_dbus_connection_close (conn, NULL, NULL, NULL);
+
g_hash_table_remove (s->connections, conn);
}