mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
tests: Fix location of an unref in the GTask tests
This method drops the last reference *it* owns to the GTask, but then continues to call methods on the GTask. This wasn’t resulting in failures because a ref in another thread kept the GTask alive, but that’s quite dodgy. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@@ -1689,7 +1689,6 @@ test_return_on_cancel_atomic (void)
|
||||
|
||||
g_task_set_task_data (task, (gpointer)&state, NULL);
|
||||
g_task_run_in_thread (task, return_on_cancel_atomic_thread);
|
||||
g_object_unref (task);
|
||||
|
||||
g_assert_cmpint (state, ==, 0);
|
||||
|
||||
@@ -1724,6 +1723,7 @@ test_return_on_cancel_atomic (void)
|
||||
g_object_unref (cancellable);
|
||||
g_mutex_unlock (&roca_mutex_1);
|
||||
g_mutex_unlock (&roca_mutex_2);
|
||||
g_object_unref (task);
|
||||
}
|
||||
|
||||
/* test_return_pointer: memory management of pointer returns */
|
||||
|
Reference in New Issue
Block a user