gdebugcontrollerdbus: Add stop() method

This allows the controller to explicitly be removed from the bus, in a
way that allows the caller to synchronise with it and know that all
other references to the controller should have been dropped (i.e. after
this method returns, there should be no in-flight D-Bus calls still
holding a reference to the object).

This is needed to be able to guarantee finalisation of the controller in
unit tests (and comparable real-world situations).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1190
This commit is contained in:
Philip Withnall
2022-02-11 11:36:28 +00:00
parent 6d5953ee48
commit 1b3e6bab53
3 changed files with 84 additions and 14 deletions

View File

@@ -61,6 +61,9 @@ GDebugControllerDBus *g_debug_controller_dbus_new (GDBusConnection *connection,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_2_72
void g_debug_controller_dbus_stop (GDebugControllerDBus *self);
G_END_DECLS
#endif /* __G_DEBUG_CONTROLLER_DBUS_H__ */