diff options
author | Logan Rathbone <poprocks@gmail.com> | 2023-05-08 13:36:51 -0400 |
---|---|---|
committer | Logan Rathbone <poprocks@gmail.com> | 2023-05-08 13:36:51 -0400 |
commit | aa4b8c159f157dfe2d7ef397238c3873ad7050ae (patch) | |
tree | e45aa6d1b4b4aedd5ebcf039a63b3bd9cd9d80bf | |
parent | 93d4c88cea5167cc6d2bed8b85b7931399068d59 (diff) | |
download | zenity-aa4b8c159f157dfe2d7ef397238c3873ad7050ae.tar.gz |
util: Ignore superfluous quit requests
This should prevent potential race conditions with STDIN handling.
-rw-r--r-- | src/util.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -454,6 +454,14 @@ zenity_util_gapp_main (GtkWindow *window) void zenity_util_gapp_quit (GtkWindow *window, ZenityData *data) { + static gboolean quit_requested = FALSE; + + if (quit_requested) + { + g_debug ("%s: Quit request already pending. Ignoring superfluous quit request.", __func__); + return; + } + /* This is a bit hack-ish, but GApplication doesn't really allow for * customized exit statuses within that API. */ @@ -464,6 +472,8 @@ zenity_util_gapp_quit (GtkWindow *window, ZenityData *data) gtk_window_destroy (window); else g_application_release (g_application_get_default ()); + + quit_requested = TRUE; } int |