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
This commit is contained in:
Beniamino Galvani 2015-09-08 18:12:28 +02:00
parent 998ab88949
commit 8318672fe9

View file

@ -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);
}