summaryrefslogtreecommitdiff
path: root/lib/TaskMan.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-12-22 02:06:30 +0000
committerPixel <Pixel>2001-12-22 02:06:30 +0000
commit4355c6e9835e08e42d8d082ada4470293faef2ca (patch)
treee577e8022758fc3f8c06f5aaf27b35fe5c3fce63 /lib/TaskMan.cc
parent1ab3f478e7333620e3f8d424d27bd86e54886a3f (diff)
TaskMan => a father kills his childrens.
Diffstat (limited to 'lib/TaskMan.cc')
-rw-r--r--lib/TaskMan.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc
index 5b29d1c..c688f8a 100644
--- a/lib/TaskMan.cc
+++ b/lib/TaskMan.cc
@@ -115,6 +115,16 @@ void TaskMan::RemoveFromWatches(Task * t) {
p--;
}
}
+
+ for (TaskList_t::iterator p = TaskList.begin(); p && (p != TaskList.end()); p++) {
+ if ((*p)->WaitedBy() == t) {
+ Zombies.push_back(*p);
+ (*p)->RemoveFromWatches();
+ TaskList.erase(p);
+ number--;
+ p--;
+ }
+ }
}
void TaskMan::WaitFor(Handle * h, Task * t, int flags) {
@@ -328,7 +338,7 @@ void TaskMan::MainLoop() throw (GeneralException) {
if (o->GetState() == TASK_DONE) {
TaskList_t::iterator f = FindTask(o);
if (!f) {
- throw GeneralException(_("TaskMan: internal error (task not found)"));
+ throw GeneralException(_("TaskMan: internal error (task not found) -- SHOULD NOT HAPPEN!!"));
}
TaskList.erase(f);
number--;