From 79055c1961a1f2155632a2d19f5135bda8e93f5a Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Wed, 19 Feb 2003 20:16:03 +0000 Subject: fix some segfaults caused by still calling destroy or other gtk functions after a destroy has been already done, triggered by the user clicking on the WM's "close this application" button (#1651) --- perl-install/ugtk2.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 950801ae9..07d6fbfb4 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -746,7 +746,7 @@ sub new { $o->{rwindow}->set_position('center-always') if $::isStandalone; $o->{rwindow}->set_modal(1) if ($grab || $o->{grab} || $o->{modal}) && !$::isInstall; $o->{rwindow}->set_transient_for($o->{transient}) if $o->{transient}; - + $o->{rwindow}->signal_connect(destroy => sub { $o->{destroyed} = 1 }); $o->{pop_it} ||= $pop_it || $::WizardTable && do { my @l = $::WizardTable->get_children; @@ -840,7 +840,7 @@ sub main { do { Gtk2->main; - } while ($o->{retval} ? $completed && !$completed->() : $canceled && !$canceled->()); + } while (!$o->{destroyed} && ($o->{retval} ? $completed && !$completed->() : $canceled && !$canceled->())); $o->destroy; $o->{retval} } @@ -852,7 +852,6 @@ sub show($) { sub destroy($) { my ($o) = @_; $o->{rwindow}->destroy if !$o->{destroyed}; - $o->{destroyed} = 1; #- the perl DESTROY will call us, so avoid Gtk-CRITICAL if user explicitely called us before gtkset_mousecursor_wait(); flush(); } -- cgit v1.2.1