Commit 1e2d0138 by Marcus Winter

dataflow_cpp: fixed bug with global network instances in mtapi scheduler

parent 84b41395
...@@ -66,15 +66,18 @@ class SchedulerMTAPI : public Scheduler { ...@@ -66,15 +66,18 @@ class SchedulerMTAPI : public Scheduler {
} }
} }
virtual ~SchedulerMTAPI() { virtual ~SchedulerMTAPI() {
if (embb::tasks::Node::IsInitialized()) {
// only destroy groups and queues if there still is an instance
embb::tasks::Node & node = embb::tasks::Node::GetInstance(); embb::tasks::Node & node = embb::tasks::Node::GetInstance();
for (int ii = 0; ii < slices_; ii++) { for (int ii = 0; ii < slices_; ii++) {
group_[ii]->WaitAll(MTAPI_INFINITE); group_[ii]->WaitAll(MTAPI_INFINITE);
node.DestroyGroup(*group_[ii]); node.DestroyGroup(*group_[ii]);
} }
embb::base::Allocation::Free(group_);
for (int ii = 0; ii < queue_count_; ii++) { for (int ii = 0; ii < queue_count_; ii++) {
node.DestroyQueue(*queue_[ii]); node.DestroyQueue(*queue_[ii]);
} }
}
embb::base::Allocation::Free(group_);
embb::base::Allocation::Free(queue_); embb::base::Allocation::Free(queue_);
} }
virtual void Spawn(Action & action) { virtual void Spawn(Action & action) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment