diff --git a/ChangeLog b/ChangeLog index b1277c5c76..d95cfd9088 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-18 Sven Neumann + + * app/batch.c (batch_exit_after_callback): synced cleanup + procedure with app_exit_after_callback() and documented its purpose. + 2008-02-18 Michael Natterer * app/tools/gimpgegltool.c (gimp_gegl_tool_config_get_property): diff --git a/app/batch.c b/app/batch.c index c3fb375b44..d11dba6586 100644 --- a/app/batch.c +++ b/app/batch.c @@ -21,11 +21,11 @@ #include #include -#include +#include #include "core/core-types.h" -#include "base/base.h" +#include "base/tile-swap.h" #include "core/gimp.h" #include "core/gimpparamspecs.h" @@ -41,8 +41,7 @@ #define BATCH_DEFAULT_EVAL_PROC "plug-in-script-fu-eval" -static gboolean batch_exit_after_callback (Gimp *gimp, - gboolean kill_it); +static gboolean batch_exit_after_callback (Gimp *gimp); static void batch_run_cmd (Gimp *gimp, const gchar *proc_name, GimpProcedure *procedure, @@ -118,15 +117,23 @@ batch_run (Gimp *gimp, } +/* + * The purpose of this handler is to exit GIMP cleanly when the batch + * procedure calls the gimp-exit procedure. Without this callback, the + * message "batch command experienced an execution error" would appear + * and gimp would hang forever. + */ static gboolean -batch_exit_after_callback (Gimp *gimp, - gboolean kill_it) +batch_exit_after_callback (Gimp *gimp) { if (gimp->be_verbose) - g_print ("EXIT: %s\n", G_STRLOC); + g_print ("EXIT: batch_exit_after_callback\n"); + + gegl_exit (); + + /* make sure that the swap files are removed before we quit */ + tile_swap_exit (); - /* make sure that the swap file is removed before we quit */ - base_exit (); exit (EXIT_SUCCESS); return TRUE;