gimp r26998 - in trunk: . plug-ins/script-fu



Author: neo
Date: Thu Sep 18 16:17:32 2008
New Revision: 26998
URL: http://svn.gnome.org/viewvc/gimp?rev=26998&view=rev

Log:
2008-09-18  Sven Neumann  <sven gimp org>

	* plug-ins/script-fu/script-fu-scripts.c 
(script_fu_script_proc):
	don't leak the GError.



Modified:
   trunk/ChangeLog
   trunk/plug-ins/script-fu/script-fu-scripts.c

Modified: trunk/plug-ins/script-fu/script-fu-scripts.c
==============================================================================
--- trunk/plug-ins/script-fu/script-fu-scripts.c	(original)
+++ trunk/plug-ins/script-fu/script-fu-scripts.c	Thu Sep 18 16:17:32 2008
@@ -653,8 +653,7 @@
     {
       SFScript *script = list->data;
 
-      script_fu_script_install_proc (script,
-                                     script_fu_script_proc);
+      script_fu_script_install_proc (script, script_fu_script_proc);
     }
 
   return FALSE;
@@ -699,10 +698,16 @@
                        gint             *nreturn_vals,
                        GimpParam       **return_vals)
 {
-  static GimpParam   values[2];
-  GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
+  static GimpParam   values[2] = { 0, };
+  GimpPDBStatusType  status    = GIMP_PDB_SUCCESS;
   SFScript          *script;
-  GError            *error  = NULL;
+  GError            *error     = NULL;
+
+  if (values[1].type == GIMP_PDB_STRING && values[1].data.d_string)
+    {
+      g_free (values[1].data.d_string);
+      values[1].data.d_string = NULL;
+    }
 
   *nreturn_vals = 1;
   *return_vals  = values;
@@ -760,6 +765,9 @@
                   *nreturn_vals           = 2;
                   values[1].type          = GIMP_PDB_STRING;
                   values[1].data.d_string = error->message;
+
+                  error->message = NULL;
+                  g_error_free (error);
                 }
 
               g_free (command);
@@ -782,6 +790,9 @@
                 *nreturn_vals           = 2;
                 values[1].type          = GIMP_PDB_STRING;
                 values[1].data.d_string = error->message;
+
+                error->message = NULL;
+                g_error_free (error);
               }
 
             g_free (command);



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