Index: kprocctrl.cpp =================================================================== --- kprocctrl.cpp (revision 530108) +++ kprocctrl.cpp (working copy) @@ -134,7 +134,19 @@ handlerSet = false; #ifdef Q_OS_UNIX - sigaction( SIGCHLD, &oldChildHandlerData, 0 ); + struct sigset_t mask, omask; + sigemptyset( &mask ); + sigaddset( &mask, SIGCHLD ); + sigprocmask( SIG_BLOCK, &mask, &omask ); + + struct sigaction act; + sigaction( SIGCHLD, &oldChildHandlerData, &act ); + if (act.sa_handler != theReaper) { + sigaction( SIGCHLD, &act, 0 ); + handlerSet = true; + } + + sigprocmask( SIG_SETMASK, &omask, 0 ); #else //TODO: win32 #endif Index: kapplication.cpp =================================================================== --- kapplication.cpp (revision 530108) +++ kapplication.cpp (working copy) @@ -95,8 +95,6 @@ #include #endif -#include "kprocctrl.h" - #ifdef HAVE_PATHS_H #include #endif @@ -551,8 +549,6 @@ ::exit(127); } - KProcessController::ref(); - (void) KClipboardSynchronizer::self(); QApplication::setDesktopSettingsAware( false ); @@ -1157,8 +1153,6 @@ delete smw; - KProcessController::deref(); - #ifdef Q_WS_X11 if ( d->oldXErrorHandler != NULL ) XSetErrorHandler( d->oldXErrorHandler );