gegl r1815 - in trunk: . gegl gegl/module gegl/property-types



Author: kcozens
Date: Mon Jan  7 03:28:15 2008
New Revision: 1815
URL: http://svn.gnome.org/viewvc/gegl?rev=1815&view=rev

Log:
2008-01-06  Kevin Cozens  <kcozens cvs gnome org>

	* gegl/gegl-init.c: Made variable module_db global to file. Unref it
	in gegl_exit().

	* gegl/module/geglmoduledb.c: (valid_module_name): Use G_MODULE_SUFFIX
	instead of a hard-coded suffix.

	* gegl/property-types/gegl-color.c (value_set_default):
	* gegl/property-types/gegl-curve.c (value_set_default):
	* gegl/property-types/gegl-vector.c (value_set_default): Removed call
	to g_object_ref() that was causing a ref count error.


Modified:
   trunk/ChangeLog
   trunk/gegl/gegl-init.c
   trunk/gegl/module/geglmoduledb.c
   trunk/gegl/property-types/gegl-color.c
   trunk/gegl/property-types/gegl-curve.c
   trunk/gegl/property-types/gegl-vector.c

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Mon Jan  7 03:28:15 2008
@@ -1,3 +1,16 @@
+2008-01-06  Kevin Cozens  <kcozens cvs gnome org>
+
+	* gegl/gegl-init.c: Made variable module_db global to file. Unref it
+	in gegl_exit().
+
+	* gegl/module/geglmoduledb.c: (valid_module_name): Use G_MODULE_SUFFIX
+	instead of a hard-coded suffix.
+
+	* gegl/property-types/gegl-color.c (value_set_default):
+	* gegl/property-types/gegl-curve.c (value_set_default):
+	* gegl/property-types/gegl-vector.c (value_set_default): Removed call
+	to g_object_ref() that was causing a ref count error.
+
 2008-01-07  Ãyvind KolÃs  <pippin gimp org>
 
 	* gegl/graph/gegl-node-context.c: added some extra debug output for

Modified: trunk/gegl/gegl-init.c
==============================================================================
--- trunk/gegl/gegl-init.c	(original)
+++ trunk/gegl/gegl-init.c	Mon Jan  7 03:28:15 2008
@@ -43,9 +43,11 @@
                                        GError        **error);
 
 
-static gboolean gegl_initialized = FALSE;
+static gboolean      gegl_initialized = FALSE;
 
-static glong    global_time = 0;
+static GeglModuleDB *module_db   = NULL;
+
+static glong         global_time = 0;
 
 
 /**
@@ -130,7 +132,15 @@
   gegl_operation_gtype_cleanup ();
   gegl_extension_handler_cleanup ();
   gegl_buffer_allocators_free ();
+
+  if (module_db != NULL)
+    {
+      g_object_unref (module_db);
+      module_db = NULL;
+    }
+
   babl_destroy ();
+
   timing = gegl_ticks () - timing;
   gegl_instrument ("gegl", "gegl_exit", timing);
 
@@ -192,8 +202,7 @@
                       gpointer        data,
                       GError        **error)
 {
-  static GeglModuleDB *module_db = NULL;
-  glong                time;
+  glong time;
 
   if (gegl_initialized)
     return TRUE;

Modified: trunk/gegl/module/geglmoduledb.c
==============================================================================
--- trunk/gegl/module/geglmoduledb.c	(original)
+++ trunk/gegl/module/geglmoduledb.c	Mon Jan  7 03:28:15 2008
@@ -310,25 +310,16 @@
 {
   gchar *basename = g_path_get_basename (filename);
 
-#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
-/*  if (strncmp (basename, "lib", 3))
-    goto no_module;*/
-
-  if (! gegl_datafiles_check_extension (basename, ".so"))
-    goto no_module;
-#else
-  if (! gegl_datafiles_check_extension (basename, ".dll"))
-    goto no_module;
-#endif
-
-  g_free (basename);
+  if (! gegl_datafiles_check_extension (basename, "." G_MODULE_SUFFIX))
+    {
+      g_free (basename);
 
-  return TRUE;
+      return FALSE;
+    }
 
- no_module:
   g_free (basename);
 
-  return FALSE;
+  return TRUE;
 }
 
 static void

Modified: trunk/gegl/property-types/gegl-color.c
==============================================================================
--- trunk/gegl/property-types/gegl-color.c	(original)
+++ trunk/gegl/property-types/gegl-color.c	Mon Jan  7 03:28:15 2008
@@ -464,10 +464,6 @@
 {
   GeglParamColor *gegl_color = GEGL_PARAM_COLOR (param_spec);
 
-  g_object_ref (gegl_color->default_color); /* XXX:
-                                               not sure why this is needed,
-                                               but a reference is leaked
-                                               unless it his here */
   g_value_set_object (value, gegl_color->default_color);
 }
 

Modified: trunk/gegl/property-types/gegl-curve.c
==============================================================================
--- trunk/gegl/property-types/gegl-curve.c	(original)
+++ trunk/gegl/property-types/gegl-curve.c	Mon Jan  7 03:28:15 2008
@@ -467,10 +467,6 @@
 {
   GeglParamCurve *gegl_curve = GEGL_PARAM_CURVE (param_spec);
 
-  g_object_ref (gegl_curve->default_curve); /* XXX:
-                                               not sure why this is needed,
-                                               but a reference is leaked
-                                               unless it his here */
   g_value_set_object (value, gegl_curve->default_curve);
 }
 

Modified: trunk/gegl/property-types/gegl-vector.c
==============================================================================
--- trunk/gegl/property-types/gegl-vector.c	(original)
+++ trunk/gegl/property-types/gegl-vector.c	Mon Jan  7 03:28:15 2008
@@ -41,9 +41,9 @@
  *
  * The second node is always a move to, and specifies the start of the
  * first segment. Curves are automatically turned into lines upon generation.
- *              
- * s: 40, 50   
- * m: 100, 100 
+ *
+ * s: 40, 50
+ * m: 100, 100
  * l: 200, 100
  * l: 200, 50
  */
@@ -118,7 +118,7 @@
         gint   t)
 {
   Point ab,bc,cd,abbc,bccd;
- 
+
   lerp (&ab, curve[0], curve[1], t);
   lerp (&bc, curve[1], curve[2], t);
   lerp (&cd, curve[2], curve[3], t);
@@ -208,7 +208,7 @@
       iter=iter->next;
     }
   else /* creating new path */
-    { 
+    {
       head = g_malloc0 (sizeof (Head));
       head->type = 'u';
       if (type=='u')
@@ -263,7 +263,7 @@
 
         /* chop off unneeded elements */
         curve[0]->next = NULL;
-        
+
         { /* create piecevize linear approximation of bezier curve */
            gint   i;
            Point  foo[4];
@@ -281,7 +281,7 @@
                 Point iter;
 
                 bezier (pts, &iter, i);
-                
+
                 head = path_add (head, 'l', iter.x, iter.y);
              }
         }
@@ -438,12 +438,12 @@
               gint distance;
               gint offset;
               gint leftover;
-              
+
 
               a.x = x;
               a.y = y;
 
-              b.x = iter->point.x; 
+              b.x = iter->point.x;
               b.y = iter->point.y;
 
               spacing = ts->spacing * (ts->radius * MAX_RADIUS / 65536) / 65536;
@@ -468,7 +468,7 @@
                     gint radius;
 
                     lerp (&spot, &a, &b, ratio);
-                    
+
                     radius = ts->radius  * MAX_RADIUS  / 65536,
 
                     canvas_stamp (canvas,
@@ -609,7 +609,7 @@
 
   g_type_class_add_private (klass, sizeof (GeglVectorPrivate));
 
-  gegl_vector_signals[GEGL_VECTOR_CHANGED] = 
+  gegl_vector_signals[GEGL_VECTOR_CHANGED] =
     g_signal_new ("changed", G_TYPE_FROM_CLASS (klass),
                   G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
                   0 /* class offset */,
@@ -713,7 +713,7 @@
               a.x = x;
               a.y = y;
 
-              b.x = iter->point.x; 
+              b.x = iter->point.x;
               b.y = iter->point.y;
 
               distance = point_dist (&a, &b);
@@ -806,12 +806,12 @@
               gint distance;
               gint offset;
               gint leftover;
-              
+
 
               a.x = x;
               a.y = y;
 
-              b.x = iter->point.x; 
+              b.x = iter->point.x;
               b.y = iter->point.y;
 
               spacing = 10;
@@ -876,7 +876,7 @@
       /* FIXME: speed this up, combine with a "stroking" of the path */
       gdouble x, y;
       gegl_vector_calc (self, (i*1.0)/num_samples * length, &x, &y);
-      
+
       xs[i] = x;
       ys[i] = y;
     }
@@ -940,10 +940,6 @@
 {
   GeglParamVector *gegl_vector = GEGL_PARAM_VECTOR (param_spec);
 
-  g_object_ref (gegl_vector->default_vector); /* XXX:
-                                               not sure why this is needed,
-                                               but a reference is leaked
-                                               unless it his here */
   g_value_set_object (value, gegl_vector->default_vector);
 }
 



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