[glib/wip/gcleanup: 49/71] gtask: Cleanup thread pool



commit a2ac9b2d12df1029b310a9ab9e7cb905eda39196
Author: Stef Walter <stefw gnome org>
Date:   Thu Nov 7 23:02:05 2013 +0100

    gtask: Cleanup thread pool
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711799

 gio/gtask.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gio/gtask.c b/gio/gtask.c
index 3c7341b..0a62cd3 100644
--- a/gio/gtask.c
+++ b/gio/gtask.c
@@ -1801,12 +1801,18 @@ g_task_compare_priority (gconstpointer a,
 }
 
 static void
+g_task_thread_pool_cleanup (void)
+{
+  g_thread_pool_free (task_pool, TRUE, TRUE);
+}
+
+static void
 g_task_thread_pool_init (void)
 {
   task_pool = g_thread_pool_new (g_task_thread_pool_thread, NULL,
                                  10, FALSE, NULL);
   g_assert (task_pool != NULL);
-
+  G_CLEANUP_FUNC (g_task_thread_pool_cleanup);
   g_thread_pool_set_sort_function (task_pool, g_task_compare_priority, NULL);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]