mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
gdbusconnection: Document main context iteration for unsubscriptions
Add a note to the documentation of `g_dbus_connection_signal_unsubscribe()`, `g_bus_unwatch_name()` and `g_bus_unown_name()` warning about the need to continue iterating the caller’s thread-default `GMainContext` until the unsubscribe/unwatch/unown operation is complete. See the previous few commits and #1515 for an idea of the insidious bugs that can be caused by not iterating the `GMainContext` until everything’s synchronised. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@@ -858,6 +858,13 @@ guint g_bus_watch_name_on_connection_with_closures (
|
||||
*
|
||||
* Stops watching a name.
|
||||
*
|
||||
* Note that there may still be D-Bus traffic to process (relating to watching
|
||||
* and unwatching the name) in the current thread-default #GMainContext after
|
||||
* this function has returned. You should continue to iterate the #GMainContext
|
||||
* until the #GDestroyNotify function passed to g_bus_watch_name() is called, in
|
||||
* order to avoid memory leaks through callbacks queued on the #GMainContext
|
||||
* after it’s stopped being iterated.
|
||||
*
|
||||
* Since: 2.26
|
||||
*/
|
||||
void
|
||||
|
Reference in New Issue
Block a user