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:
Philip Withnall
2018-10-01 21:44:01 +01:00
parent e1f4ff6c25
commit 03232bd6a6

View File

@@ -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 */