summaryrefslogtreecommitdiffstats
path: root/gurpmi.pm
diff options
context:
space:
mode:
Diffstat (limited to 'gurpmi.pm')
-rw-r--r--gurpmi.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/gurpmi.pm b/gurpmi.pm
index b5bb20cd..64a5d023 100644
--- a/gurpmi.pm
+++ b/gurpmi.pm
@@ -103,7 +103,14 @@ sub parse_command_line() {
sub but ($) { " $_[0] " }
-sub quit () { Gtk2->main_quit }
+sub quit () {
+ if (Gtk2->main_level) {
+ Gtk2->main_quit;
+ } else {
+ # just exit if not in main loop (eg: while starting the GUI)
+ exit 1;
+ }
+}
sub add_button_box {
my ($vbox, @buttons) = @_;