summaryrefslogtreecommitdiff
path: root/src/TaskMan.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2012-04-06 11:07:28 -0700
committerPixel <pixel@nobis-crew.org>2012-04-06 11:08:57 -0700
commit7fbb819bf6f590bf2337d2277f77487ef7a5ce86 (patch)
tree1ae26f0dd2259900276ea7e881af9a88ba2a1e01 /src/TaskMan.cc
parent64de8836d4924862d6cc352f250b802e346c29be (diff)
Making the threads (as well as the taskman thread) a bit more exception-robust.
Diffstat (limited to 'src/TaskMan.cc')
-rw-r--r--src/TaskMan.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/TaskMan.cc b/src/TaskMan.cc
index 0f205cf..d91581e 100644
--- a/src/TaskMan.cc
+++ b/src/TaskMan.cc
@@ -356,9 +356,10 @@ void Balau::TaskMan::stop(int code) {
}
void * Balau::TaskMan::TaskManThread::proc() {
- m_taskMan = new Balau::TaskMan();
bool success = false;
+ m_taskMan = NULL;
try {
+ m_taskMan = new Balau::TaskMan();
m_taskMan->mainLoop();
success = true;
}
@@ -390,7 +391,8 @@ void * Balau::TaskMan::TaskManThread::proc() {
Printer::log(M_ERROR | M_ALERT, "The TaskMan thread caused an unknown exception");
}
if (!success) {
- delete m_taskMan;
+ if (m_taskMan)
+ delete m_taskMan;
m_taskMan = NULL;
TaskMan::stop(-1);
}