Merge branch 'master' into 'master'

gio, tests: fix leak of dbus connection.

See merge request GNOME/glib!463
This commit is contained in:
Philip Withnall 2018-11-12 12:13:55 +00:00
commit 4af8edb57d

11
gio/tests/gdbus-example-peer.c Normal file → Executable file
View File

@ -121,6 +121,16 @@ static const GDBusInterfaceVTable interface_vtable =
/* ---------------------------------------------------------------------------------------------------- */
static void
connection_closed (GDBusConnection *connection,
gboolean remote_peer_vanished,
GError *Error,
gpointer user_data)
{
g_print ("Client disconnected.\n");
g_object_unref (connection);
}
static gboolean
on_new_connection (GDBusServer *server,
GDBusConnection *connection,
@ -144,6 +154,7 @@ on_new_connection (GDBusServer *server,
g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);
g_object_ref (connection);
g_signal_connect (connection, "closed", G_CALLBACK (connection_closed), NULL);
registration_id = g_dbus_connection_register_object (connection,
"/org/gtk/GDBus/TestObject",
introspection_data->interfaces[0],