[glib/wip/gcleanup] gthread-deprecated: Fix repeated adding of cleanup



commit 16a6611e0f83fc93e216cccc91f9bde84ccc7285
Author: Stef Walter <stefw gnome org>
Date:   Fri Nov 8 08:43:58 2013 +0100

    gthread-deprecated: Fix repeated adding of cleanup

 glib/deprecated/gthread-deprecated.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/glib/deprecated/gthread-deprecated.c b/glib/deprecated/gthread-deprecated.c
index 09e3949..906f72c 100644
--- a/glib/deprecated/gthread-deprecated.c
+++ b/glib/deprecated/gthread-deprecated.c
@@ -1450,6 +1450,7 @@ cleanup_free_indices (void)
 void
 g_static_private_free (GStaticPrivate *private_key)
 {
+  static gboolean cleanup_pushed = FALSE;
   guint idx = private_key->index;
 
   if (!idx)
@@ -1462,8 +1463,9 @@ g_static_private_free (GStaticPrivate *private_key)
    * the same index.
    */
   G_LOCK (g_thread);
-  if (!g_thread_free_indices)
+  if (!cleanup_pushed)
     {
+      cleanup_pushed = TRUE;
       g_cleanup_list_push (G_CLEANUP_LIST, (GCleanupFunc)cleanup_free_indices,
                            NULL, G_CLEANUP_PHASE_GRAVEYARD, "cleanup_free_indices");
     }


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