mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
tests: Fix some minor memory leaks in tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
8ae07a727a
commit
39052a1cfc
@ -798,6 +798,7 @@ test_store_past_end (void)
|
|||||||
g_assert_cmpint (g_list_model_get_n_items (model), ==, 1);
|
g_assert_cmpint (g_list_model_get_n_items (model), ==, 1);
|
||||||
item = g_list_model_get_item (model, 0);
|
item = g_list_model_get_item (model, 0);
|
||||||
g_assert_nonnull (item);
|
g_assert_nonnull (item);
|
||||||
|
g_object_unref (item);
|
||||||
item = g_list_model_get_item (model, G_MAXUINT);
|
item = g_list_model_get_item (model, G_MAXUINT);
|
||||||
g_assert_null (item);
|
g_assert_null (item);
|
||||||
|
|
||||||
|
@ -412,6 +412,8 @@ test_g_rec_mutex_locker (void)
|
|||||||
/* Verify that the mutex is unlocked again */
|
/* Verify that the mutex is unlocked again */
|
||||||
thread = g_thread_new ("rec mutex unlocked", rec_mutex_unlocked_thread, &rec_mutex);
|
thread = g_thread_new ("rec mutex unlocked", rec_mutex_unlocked_thread, &rec_mutex);
|
||||||
g_thread_join (thread);
|
g_thread_join (thread);
|
||||||
|
|
||||||
|
g_rec_mutex_clear (&rec_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Thread function to check that an rw lock given in @data cannot be writer locked */
|
/* Thread function to check that an rw lock given in @data cannot be writer locked */
|
||||||
@ -478,6 +480,8 @@ test_g_rw_lock_lockers (void)
|
|||||||
* the locks taken above have been correctly released. */
|
* the locks taken above have been correctly released. */
|
||||||
g_assert_true (g_rw_lock_writer_trylock (&lock));
|
g_assert_true (g_rw_lock_writer_trylock (&lock));
|
||||||
g_rw_lock_writer_unlock (&lock);
|
g_rw_lock_writer_unlock (&lock);
|
||||||
|
|
||||||
|
g_rw_lock_clear (&lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user