[glib/wip/gcleanup: 24/71] threadpool-test: Cleanup memory in test
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gcleanup: 24/71] threadpool-test: Cleanup memory in test
- Date: Wed, 13 Nov 2013 11:36:16 +0000 (UTC)
commit 2361bf79ca98acde9a6c76e5db96369fed1f8948
Author: Stef Walter <stefw gnome org>
Date: Sat Nov 9 20:53:48 2013 +0100
threadpool-test: Cleanup memory in test
https://bugzilla.gnome.org/show_bug.cgi?id=711744
tests/threadpool-test.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/tests/threadpool-test.c b/tests/threadpool-test.c
index 1c8aa06..3e19055 100644
--- a/tests/threadpool-test.c
+++ b/tests/threadpool-test.c
@@ -243,6 +243,12 @@ test_thread_sort_entry_func (gpointer data, gpointer user_data)
}
static void
+free_thread_pool (GThreadPool *pool)
+{
+ g_thread_pool_free (pool, TRUE, TRUE);
+}
+
+static void
test_thread_sort (gboolean sort)
{
GThreadPool *pool;
@@ -295,6 +301,7 @@ test_thread_sort (gboolean sort)
g_assert (g_thread_pool_get_max_threads (pool) == max_threads);
g_assert (g_thread_pool_get_num_threads (pool) == g_thread_pool_get_max_threads (pool));
+ G_CLEANUP (pool, free_thread_pool);
}
static void
@@ -449,6 +456,8 @@ test_check_start_and_stop (gpointer user_data)
return continue_timeout;
}
+G_CLEANUP_DEFINE;
+
int
main (int argc, char *argv[])
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]