[glib/wip/gcleanup: 72/106] gvalue: Cleanup global static data



commit e39e02d8941d622bf9bfa6e0a7edcfe9dc81d6f8
Author: Stef Walter <stefw gnome org>
Date:   Thu Nov 7 22:56:56 2013 +0100

    gvalue: Cleanup global static data
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711778

 gobject/gvalue.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gvalue.c b/gobject/gvalue.c
index 280969e..b5c66ec 100644
--- a/gobject/gvalue.c
+++ b/gobject/gvalue.c
@@ -137,10 +137,18 @@ static GBSearchConfig transform_bconfig = {
 
 
 /* --- functions --- */
+
+static void
+transform_array_cleanup (void)
+{
+  g_bsearch_array_free (transform_array, &transform_bconfig);
+}
+
 void
 _g_value_c_init (void)
 {
   transform_array = g_bsearch_array_create (&transform_bconfig);
+  G_CLEANUP_FUNC (transform_array_cleanup);
 }
 
 static inline void             /* keep this function in sync with gvaluecollector.h and gboxed.c */


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