From 9347c7630f2e504685a0de4f5b1ebf82dba31505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Thu, 1 Nov 2018 00:00:00 +0000 Subject: [PATCH] tests: Fix GRand leak in GMenuModel tests --- gio/tests/gmenumodel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gio/tests/gmenumodel.c b/gio/tests/gmenumodel.c index 5d6f485c4..53e701360 100644 --- a/gio/tests/gmenumodel.c +++ b/gio/tests/gmenumodel.c @@ -1160,6 +1160,8 @@ do_modify (gpointer data) random_menu_change (menu, rand); } + g_rand_free (rand); + return NULL; } @@ -1201,9 +1203,11 @@ test_dbus_threaded (void) for (i = 0; i < 10; i++) { - menu[i] = random_menu_new (g_rand_new_with_seed (g_test_rand_int ()), 2); + GRand *rand = g_rand_new_with_seed (g_test_rand_int ()); + menu[i] = random_menu_new (rand, 2); call[i] = g_thread_new ("call", do_modify, menu[i]); export[i] = g_thread_new ("export", do_export, menu[i]); + g_rand_free (rand); } for (i = 0; i < 10; i++)