diff --git a/glib/tests/autoptr.c b/glib/tests/autoptr.c index dedbe5cc9..280662328 100644 --- a/glib/tests/autoptr.c +++ b/glib/tests/autoptr.c @@ -441,12 +441,17 @@ test_g_rec_mutex_locker (void) if (TRUE) { g_autoptr(GRecMutexLocker) val = g_rec_mutex_locker_new (&rec_mutex); + g_autoptr(GRecMutexLocker) other = NULL; g_assert_nonnull (val); /* Verify that the mutex is actually locked */ thread = g_thread_new ("rec mutex locked", rec_mutex_locked_thread, &rec_mutex); - g_thread_join (thread); + g_thread_join (g_steal_pointer (&thread)); + + other = g_rec_mutex_locker_new (&rec_mutex); + thread = g_thread_new ("rec mutex locked", rec_mutex_locked_thread, &rec_mutex); + g_thread_join (g_steal_pointer (&thread)); } /* Verify that the mutex is unlocked again */