gegl r2533 - in trunk: . gegl/buffer



Author: neo
Date: Mon Jul 21 20:08:04 2008
New Revision: 2533
URL: http://svn.gnome.org/viewvc/gegl?rev=2533&view=rev

Log:
2008-07-21  Sven Neumann  <sven gimp org>

	* gegl/buffer/gegl-tile-storage.c (gegl_tile_storage_finalize):
	plugged a memory leak.
	(set_property): use g_value_dup_string (value) instead of
	g_strdup (g_value_get_string (value)).

	* gegl/buffer/gegl-sampler-cubic.c (set_property): ditto.



Modified:
   trunk/ChangeLog
   trunk/gegl/buffer/gegl-sampler-cubic.c
   trunk/gegl/buffer/gegl-tile-storage.c

Modified: trunk/gegl/buffer/gegl-sampler-cubic.c
==============================================================================
--- trunk/gegl/buffer/gegl-sampler-cubic.c	(original)
+++ trunk/gegl/buffer/gegl-sampler-cubic.c	Mon Jul 21 20:08:04 2008
@@ -156,7 +156,7 @@
           {
             sampler_bptr += offsets[i];
             factor = cubicKernel (y - v, cubic->b, cubic->c) *
-                     cubicKernel (x - u, cubic->b, cubic->c);            
+                     cubicKernel (x - u, cubic->b, cubic->c);
             newval4 += g4float_mul(&sampler_bptr[0], factor);
            }
      }
@@ -189,7 +189,7 @@
               GValue     *value,
               GParamSpec *pspec)
 {
-  GeglSamplerCubic *self         = GEGL_SAMPLER_CUBIC (object);
+  GeglSamplerCubic *self = GEGL_SAMPLER_CUBIC (object);
 
   switch (prop_id)
     {
@@ -212,7 +212,7 @@
               const GValue *value,
               GParamSpec   *pspec)
 {
-  GeglSamplerCubic *self         = GEGL_SAMPLER_CUBIC (object);
+  GeglSamplerCubic *self = GEGL_SAMPLER_CUBIC (object);
 
   switch (prop_id)
     {
@@ -221,12 +221,10 @@
         break;
 
       case PROP_TYPE:
-      {
         if (self->type)
           g_free (self->type);
-        self->type = g_strdup (g_value_get_string (value));
+        self->type = g_value_dup_string (value);
         break;
-      }
 
       default:
         break;

Modified: trunk/gegl/buffer/gegl-tile-storage.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-storage.c	(original)
+++ trunk/gegl/buffer/gegl-tile-storage.c	Mon Jul 21 20:08:04 2008
@@ -146,7 +146,7 @@
       case PROP_PATH:
         if (tile_storage->path)
           g_free (tile_storage->path);
-        tile_storage->path = g_strdup (g_value_get_string (value));
+        tile_storage->path = g_value_dup_string (value);
         break;
 
       case PROP_FORMAT:
@@ -170,7 +170,7 @@
       return FALSE;
     }
 
-  return gegl_tile_source_idle (GEGL_TILE_SOURCE (tile_storage));                        
+  return gegl_tile_source_idle (GEGL_TILE_SOURCE (tile_storage));
 }
 
 GeglTileBackend *gegl_buffer_backend (GObject *buffer);
@@ -286,6 +286,9 @@
   if (self->idle_swapper)
     g_source_remove (self->idle_swapper);
 
+  if (self->path)
+    g_free (self->path);
+
   (*G_OBJECT_CLASS (parent_class)->finalize)(object);
 }
 



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