summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2007-06-25 10:11:28 +0000
committerpixel <pixel>2007-06-25 10:11:28 +0000
commitec2b59927c4fdf6ac7017efbf5f34757038be326 (patch)
tree8e1077be6d97ee3a88c0fecc1a701b7379e1e74c /lib
parent27d5c3b8f8005e5c8fd867739a6db37b5b3bc08e (diff)
Trying to be slightly nicer with the zombies... and letting them eating ressources.
Diffstat (limited to 'lib')
-rw-r--r--lib/TaskMan.cc16
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;