From a32e51142140e3886b50ba7348783d867e900d0b Mon Sep 17 00:00:00 2001 From: Andre Moreira Magalhaes Date: Tue, 23 Jul 2019 20:33:19 +0000 Subject: gdbus: Unref cached GDBusConnection objects when the connection is closed This change fixes the dbus-leak tests by dropping the cached GDBusConnection objects references when the bus connection is closed. The issue was introduced with recent changes made to GLib[1] where invoking g_test_dbus_down() will fail after a timeout if the GDBusConnection object for the session bus leaks. Given g_test_dbus_down() will first close the connection before checking for leaks unreffing the object when the connection is closed should fix the issue. [1] https://gitlab.gnome.org/GNOME/glib/merge_requests/963 Signed-off-by: Andre Moreira Magalhaes --- engine/dconf-engine.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engine') diff --git a/engine/dconf-engine.h b/engine/dconf-engine.h index 2485423..6d57782 100644 --- a/engine/dconf-engine.h +++ b/engine/dconf-engine.h @@ -67,6 +67,17 @@ GVariant * dconf_engine_dbus_call_sync_func (GBusTyp const GVariantType *expected_type, GError **error); +/* Helper function used by the client library to handle bus disconnection */ +G_GNUC_INTERNAL +void dconf_engine_dbus_handle_connection_closed (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error, + GMutex *bus_lock, + gboolean *bus_is_error, + gpointer *bus_data, + GCallback bus_closed_callback, + gpointer bus_closed_callback_user_data); + /* Notifies that a change occured. * * The engine lock is never held when calling this function so it is -- cgit v1.2.1