[gimp] Bug 575830 - script-fu-refresh crashes Script-Fu when called from a script



commit 8e5beb6d83896da421180f4d76693b5c3ae02990
Author: Michael Natterer <mitch gimp org>
Date:   Sun Oct 7 17:04:54 2012 +0200

    Bug 575830 - script-fu-refresh crashes Script-Fu when called from a script
    
    Did the most stupid fix of simply not calling the procedure if it is
    "script-fu-refresh-scripts". This is really not a use case that
    warrants complicating lots of code.

 plug-ins/script-fu/scheme-wrapper.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/script-fu/scheme-wrapper.c b/plug-ins/script-fu/scheme-wrapper.c
index d8d67f0..e7e00d3 100644
--- a/plug-ins/script-fu/scheme-wrapper.c
+++ b/plug-ins/script-fu/scheme-wrapper.c
@@ -1258,13 +1258,19 @@ script_fu_marshal_procedure_call (scheme  *sc,
 
   if (success)
     {
+      /* refuse to refresh scripts from a script, better than crashing
+       * see bug #575830
+       */
+      if (strcmp (proc_name, "script-fu-refresh-scripts"))
+        {
 #if DEBUG_MARSHALL
-      g_printerr ("    calling %s...", proc_name);
+          g_printerr ("    calling %s...", proc_name);
 #endif
-      values = gimp_run_procedure2 (proc_name, &nvalues, nparams, args);
+          values = gimp_run_procedure2 (proc_name, &nvalues, nparams, args);
 #if DEBUG_MARSHALL
-      g_printerr ("  done.\n");
+          g_printerr ("  done.\n");
 #endif
+        }
     }
   else
     {



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