I suspect there is something nasty happening when you re-enter abort_routine. You could add:
my $inAbort;
at the top of the script and change abort_routine to:
sub abort_routine { return if $inAbort; $inAbort = 1; debug("+abort_routine"); debug("abort_routine Array_Index: $Array_Index"); # DO SOMETHING USEFUL HERE TO CLEAN UP THE PROCESS $MW->destroy(); debug("-abort_routine"); }
so that abort_routine is not re-entered during the destroy or (probably better) change the button command to initiate a different sub that just performs $MW->destroy ();:
... $button = $MW->Button( -text => "Shutdown and close", -command => [ \&do_close ] )->pack( -side => 'bottom' ); ... sub abort_routine { debug("+abort_routine"); debug("abort_routine Array_Index: $Array_Index"); # DO SOMETHING USEFUL HERE TO CLEAN UP THE PROCESS debug("-abort_routine"); } sub do_close { $MW->destroy(); }
In reply to Re^3: Getting segfaults when destroying and recreating Tk box
by GrandFather
in thread Getting segfaults when destroying and recreating Tk box
by skt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |