A bit late to this conversation, but I have also had similar problems. 
My mostly working solution is to make sure that I don't kill the app
from the taskbar thread.  To get around this I have a single close event
attached to some other window and I post an close event over to that
window when clicking on the taskbar menu

  my $canary = Wx::Window::FindWindowById($main::WX_ID_CANARY, undef);
  my $event = Wx::CommandEvent->new( $main::ID_APP_EXIT, -1 );
  $canary->AddPendingEvent($event);


This event gets caught and the real close routine is run from there

I find this removes *most* crashes, but I still get occasional ones
after packaging the app using Activestate perlapp... For some reason it
often crashes on exiting the very first run, but it's ok on subsequent
runs (some race condition)


The other thing which kind of helped was getting rid of all the circular
references so that the app shuts down cleanly simply by closing the main
window.  I spent a lot of time trying to debug why the app wouldn't
always shutdown - still not quite sure - I would remove swathes of my
app until it shutdown cleanly and then add it back piece by piece (and I
think it's still not reliably dying without a bit of proding and
forceably closing windows - something getting stuck somewhere for
unknown reasons...)

Oh well, good luck

Ed W

Reply via email to