app: exit GIMP more cleanly when quitting immediately after batch calls.
Call gimp_exit() rather than emitting the signal ourselves. This way in particular, the still-opened images are properly freed and we avoid GeglBuffer leaks from images we might have created in a batch script, or the images loaded in command lines.
This commit is contained in:
parent
296772f4d9
commit
46a335b68e
1 changed files with 8 additions and 13 deletions
21
app/app.c
21
app/app.c
|
|
@ -428,20 +428,15 @@ app_run (const gchar *full_prog_name,
|
|||
retval = gimp_batch_run (gimp, batch_interpreter, batch_commands);
|
||||
|
||||
if (quit)
|
||||
{
|
||||
/* Return value, needed for the signal call; let's just ignore the
|
||||
* result. */
|
||||
gboolean cb_retval;
|
||||
|
||||
g_signal_emit_by_name (gimp, "exit", TRUE, &cb_retval);
|
||||
}
|
||||
/* Emit the "exit" signal, but also properly free all images still
|
||||
* opened.
|
||||
*/
|
||||
gimp_exit (gimp, TRUE);
|
||||
else
|
||||
{
|
||||
/* Only take into account the batch commands' success when we
|
||||
* return immediately.
|
||||
*/
|
||||
retval = EXIT_SUCCESS;
|
||||
}
|
||||
/* Only take into account the batch commands' success when we
|
||||
* return immediately.
|
||||
*/
|
||||
retval = EXIT_SUCCESS;
|
||||
|
||||
if (run_loop)
|
||||
g_main_loop_run (loop);
|
||||
|
|
|
|||
Loading…
Reference in a new issue