mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-04 00:13:40 +02:00
GDBus: Unref worker from worker-thread to avoid race
... otherwise we might end up using the worker after it has been freed. Reported by Dan Winship and Colin Walters. This fix uncovered a bug in the /gdbus/nonce-tcp test case so "fix" that as well to use a better way of having one thread wait for another (using quotes for the word "fix" since it's pretty hackish to busy-wait in one thread to wait for another). Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
@@ -1206,7 +1206,7 @@ test_nonce_tcp (void)
|
||||
g_assert_no_error (error);
|
||||
g_assert (c != NULL);
|
||||
while (data.current_connections->len < 1)
|
||||
g_main_loop_run (loop);
|
||||
g_thread_yield ();
|
||||
g_assert_cmpint (data.current_connections->len, ==, 1);
|
||||
g_assert_cmpint (data.num_connection_attempts, ==, 1);
|
||||
g_assert (g_dbus_connection_get_unique_name (c) == NULL);
|
||||
|
Reference in New Issue
Block a user