diff options
-rw-r--r-- | lib/TaskMan.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc index 4f18a85..5064048 100644 --- a/lib/TaskMan.cc +++ b/lib/TaskMan.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: TaskMan.cc,v 1.46 2007-05-30 11:57:10 pixel Exp $ */ +/* $Id: TaskMan.cc,v 1.47 2007-06-25 10:11:28 pixel Exp $ */ #ifndef _WIN32 #include <signal.h> @@ -741,10 +741,16 @@ void TaskMan::MainLoop() throw (GeneralException) { bool TaskMan::CheckDead(Task * t) { if (t->GetState() == Task::TASK_DONE) { - TaskList_t::iterator f = FindTask(t); - TaskList.erase(f); - number--; - Zombies.push_back(t); + try { + TaskList_t::iterator f = FindTask(t); + TaskList.erase(f); + number--; + Zombies.push_back(t); + } + catch (TaskNotFound e) { + printm(M_WARNING, "TaskNotFound exception catched. There is probably a zombie lurking around.\n"); + return false; + } return true; } return false; |