[glib/wip/gcleanup: 54/78] gtask: Cleanup thread pool



commit 1450ce4b65ee6db70aca942a4278e36462043088
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]