From ec2b59927c4fdf6ac7017efbf5f34757038be326 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 25 Jun 2007 10:11:28 +0000 Subject: Trying to be slightly nicer with the zombies... and letting them eating ressources. --- lib/TaskMan.cc | 16 +++++++++++----- 1 file 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 @@ -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; -- cgit v1.2.3