From 6ca43f4f817ae586c792748f27bba5742e182952 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Thu, 5 Feb 1998 05:41:05 +0000 Subject: [PATCH] now gimp quits correctly again! -timj --- app/app_procs.c | 18 ++++++++++++++---- app/app_procs.h | 1 + app/main.c | 7 +++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/app/app_procs.c b/app/app_procs.c index adde68d87d..42b0e546b4 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -62,6 +62,8 @@ static void make_initialization_status_window(void); static void destroy_initialization_status_window(void); +static gint is_app_exit_finish_done = FALSE; + static ProcArg quit_args[] = { { PDB_INT32, @@ -283,12 +285,18 @@ app_init () } +gint +app_exit_finish_done (void) +{ + return is_app_exit_finish_done; +} + void app_exit_finish () { - static gint once = 0; - if (once) return; - once = 1; + if (app_exit_finish_done ()) + return; + is_app_exit_finish_done = TRUE; lc_dialog_free (); gdisplays_delete (); @@ -328,8 +336,10 @@ app_exit (int kill_it) /* If it's the user's perogative, and there are dirty images */ if (kill_it == 0 && gdisplays_dirty () && no_interface == FALSE) really_quit_dialog (); - else + else if (no_interface == FALSE) toolbox_free (); + else + app_exit_finish (); } /******************************************************** diff --git a/app/app_procs.h b/app/app_procs.h index fd67266c51..d89d4fb2e0 100644 --- a/app/app_procs.h +++ b/app/app_procs.h @@ -23,6 +23,7 @@ void gimp_init (int, char **); void app_init (void); void app_exit (int); void app_exit_finish (void); +gint app_exit_finish_done (void); void app_init_update_status(char *label1val, char *label2val, float pct_progress); #endif /* APP_PROCS_H */ diff --git a/app/main.c b/app/main.c index e81c9764d8..2498427a0f 100644 --- a/app/main.c +++ b/app/main.c @@ -68,7 +68,7 @@ static char **gimp_argv; * commands. */ -void +int main (int argc, char **argv) { int show_version; @@ -201,7 +201,10 @@ main (int argc, char **argv) install_verify (init); /* Main application loop */ - gtk_main (); + if (!app_exit_finish_done ()) + gtk_main (); + + return 0; } static void