Merge branch 'wip/3v1n0/sanitizer-memory-fixes' into 'main'

Memory sanitizer fixes

See merge request GNOME/glib!4484
This commit is contained in:
Philip Withnall
2025-04-03 13:04:05 +00:00
12 changed files with 88 additions and 27 deletions

View File

@@ -539,7 +539,7 @@ test_connection_signal_handler (GDBusConnection *connection,
/* We defer quitting to a G_PRIORITY_DEFAULT_IDLE function so other queued signal
* callbacks have a chance to run first. They get dispatched with a higher priority
* of G_PIORITY_DEFAULT, so as long as the queue is non-empty g_main_loop_quit won't
* of G_PRIORITY_DEFAULT, so as long as the queue is non-empty g_main_loop_quit won't
* run
*/
g_idle_add_once ((GSourceOnceFunc) g_main_loop_quit, loop);

View File

@@ -1960,6 +1960,17 @@ test_threaded_unregistration_iteration (gboolean subtree)
g_clear_object (&call_result);
g_clear_object (&data.connection);
/* We defer quitting to a G_PRIORITY_DEFAULT_IDLE function so other queued
* signal callbacks have a chance to run first.
* In particular we want to ensure that all calls to on_object_unregistered()
* are delivered here before we end this function, so that there won't be any
* invalid stack access.
* They get dispatched with a higher priority (G_PRIORITY_DEFAULT), so as
* long as the queue is non-empty g_main_loop_quit won't run
*/
g_idle_add_once ((GSourceOnceFunc) g_main_loop_quit, loop);
g_main_loop_run (loop);
return unregistration_was_first;
}