[gegl] operation: Stop leaking operation class references.



commit fc2d06dc7e65ffa50b2f6f2264471e6d694d1cc9
Author: Michael Henning <drawoc darkrefraction com>
Date:   Wed Aug 7 17:13:47 2013 -0400

    operation: Stop leaking operation class references.

 gegl/operation/gegl-operations.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/gegl/operation/gegl-operations.c b/gegl/operation/gegl-operations.c
index 410dbda..531fddb 100644
--- a/gegl/operation/gegl-operations.c
+++ b/gegl/operation/gegl-operations.c
@@ -71,7 +71,6 @@ add_operations (GType parent)
   GType *types;
   guint  count;
   guint  no;
-  G_LOCK_DEFINE_STATIC (type_class_peek_and_ref);
 
   types = g_type_children (parent, &count);
   if (!types)
@@ -79,12 +78,11 @@ add_operations (GType parent)
 
   for (no = 0; no < count; no++)
     {
-      G_LOCK (type_class_peek_and_ref);
-
-      if (!g_type_class_peek (types[no]))
-        g_type_class_ref (types[no]);
-
-      G_UNLOCK (type_class_peek_and_ref);
+      /*
+       * Poke the operation so it registers its name with
+       * gegl_operation_class_register_name
+       */
+      g_type_class_unref (g_type_class_ref (types[no]));
 
       add_operations (types[no]);
     }


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