From 56f71590d8582780ca7a44b33c2f5d3975999398 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 7 Jul 2002 16:07:25 +0000 Subject: make the buttons work in all cases - workaround segfaults - ensure the perl values are set when calling the clicked_may_quit callback --- perl-install/interactive_newt.pm | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'perl-install') diff --git a/perl-install/interactive_newt.pm b/perl-install/interactive_newt.pm index 431a39930..d930b9f29 100644 --- a/perl-install/interactive_newt.pm +++ b/perl-install/interactive_newt.pm @@ -193,26 +193,22 @@ sub ask_fromW { local $::setstep = 1; $form->RunForm; }; - foreach (@widgets) { - if ($$r == ${$_->{w}}) { - $destroyed = 1; - $form->FormDestroy; - Newt::PopWindow; - my $v = do { - local $::setstep = 1; - $_->{e}{clicked_may_quit}(); - }; - $v or return ask_fromW($o, $common, $l, $l2); - } - } $canceled = $cancel && $$r == $$cancel; + if (my ($button) = grep { $$r == ${$_->{w}} } @widgets) { + $get_all->(); + my $v = do { + local $::setstep = 1; + $button->{e}{clicked_may_quit}(); + }; + $form->FormDestroy; + Newt::PopWindow; + return $v || &ask_fromW; + } } until ($check->($common->{callbacks}{$canceled ? 'canceled' : 'complete'})); - if (!$destroyed) { - $form->FormDestroy; - Newt::PopWindow; - } + $form->FormDestroy; + Newt::PopWindow; !$canceled; } -- cgit v1.2.1