Fix Util::TerminationNotifier deadlock when calling malloc() inside a signal handler.

This commit is contained in:
Thulinma 2012-08-24 15:09:35 +02:00
parent 5e640c09b9
commit ca0fd8a641

View file

@ -56,12 +56,12 @@ void Util::Procs::childsig_handler(int signum){
} }
#endif #endif
TerminationNotifier tn = exitHandlers[ret]; if (exitHandlers.count(ret) > 0){
exitHandlers.erase(ret); TerminationNotifier tn = exitHandlers[ret];
if (tn){ exitHandlers.erase(ret);
#if DEBUG >= 2 #if DEBUG >= 2
std::cerr << "Calling termination handler for " << pname << std::endl; std::cerr << "Calling termination handler for " << pname << std::endl;
#endif #endif
tn(ret, exitcode); tn(ret, exitcode);
} }
} }