mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-19 15:18:55 +02:00
Merge branch 'master' into 'master'
gio, tests: fix leak of dbus connection. See merge request GNOME/glib!463
This commit is contained in:
11
gio/tests/gdbus-example-peer.c
Normal file → Executable file
11
gio/tests/gdbus-example-peer.c
Normal file → Executable 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
|
static gboolean
|
||||||
on_new_connection (GDBusServer *server,
|
on_new_connection (GDBusServer *server,
|
||||||
GDBusConnection *connection,
|
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_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);
|
||||||
|
|
||||||
g_object_ref (connection);
|
g_object_ref (connection);
|
||||||
|
g_signal_connect (connection, "closed", G_CALLBACK (connection_closed), NULL);
|
||||||
registration_id = g_dbus_connection_register_object (connection,
|
registration_id = g_dbus_connection_register_object (connection,
|
||||||
"/org/gtk/GDBus/TestObject",
|
"/org/gtk/GDBus/TestObject",
|
||||||
introspection_data->interfaces[0],
|
introspection_data->interfaces[0],
|
||||||
|
Reference in New Issue
Block a user