Jim Clark wrote:
I am hoping someone on this list can answer this question. I have notice that during certain situations signal handlers I set up are ignored in my wxPerl application. Especially while modal dialogs are open.
For example, I fork() a process to run a subroutine asynchronously, setting up 
the $SIG{CHLD} handler for when the sub-process completes. I open a modal 
dialog which alerts the user that the process is running and there is a button 
on it that allows them to cancel the action.  However, after the subprocess 
completes, the handler is not called. It is only when I close the modal dialog 
that the handler then gets called.

Why is this happening? I have noticed this behavior with other signals as well, 
like SIGINT. Is the wxWidgets mainloop deliberately ignoring all signals? Does 
it have something to do with the event processing?

Since Perl 5.8, signals are only dispatched when the Perl runloop is running; when a modal dialog is displayed, Perl is stuck inside the show call.

I think just adding a timer that periodically calls an empty subroutine should suffice for signals to be delivered.

HTH,
Mattia

Reply via email to