gegl r2939 - trunk/gegl/operation



Author: martinn
Date: Sun Feb 22 18:54:06 2009
New Revision: 2939
URL: http://svn.gnome.org/viewvc/gegl?rev=2939&view=rev

Log:
Decrease scope of 'value' in gegl_operation_context_set_object()

Modified:
   trunk/gegl/operation/gegl-operation-context.c

Modified: trunk/gegl/operation/gegl-operation-context.c
==============================================================================
--- trunk/gegl/operation/gegl-operation-context.c	(original)
+++ trunk/gegl/operation/gegl-operation-context.c	Sun Feb 22 18:54:06 2009
@@ -243,7 +243,6 @@
                                    GObject              *data)
 {
   GParamSpec *pspec;
-  GValue      value = {0, };
 
   /* FIXME: check that there isn't already an existing 
    *        output object/value set?
@@ -252,9 +251,13 @@
   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (context->operation)), padname);
   if (pspec)
   {
+    GValue value = {0, };
     g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+
     g_value_set_object (&value, data);
     gegl_operation_context_set_property (context, padname, &value);
+
+    g_value_unset (&value);
   }
   else
     {
@@ -263,7 +266,6 @@
         g_object_unref (data); /* are we stealing the initial reference? */
       return;
     }
-  g_value_unset (&value);
   g_object_unref (data); /* are we stealing the initial reference? */
 }
 



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