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() {
embb::tasks::Node & node = embb::tasks::Node::GetInstance(); if (embb::tasks::Node::IsInitialized()) {
for (int ii = 0; ii < slices_; ii++) { // only destroy groups and queues if there still is an instance
group_[ii]->WaitAll(MTAPI_INFINITE); embb::tasks::Node & node = embb::tasks::Node::GetInstance();
node.DestroyGroup(*group_[ii]); for (int ii = 0; ii < slices_; ii++) {
group_[ii]->WaitAll(MTAPI_INFINITE);
node.DestroyGroup(*group_[ii]);
}
for (int ii = 0; ii < queue_count_; ii++) {
node.DestroyQueue(*queue_[ii]);
}
} }
embb::base::Allocation::Free(group_); embb::base::Allocation::Free(group_);
for (int ii = 0; ii < queue_count_; ii++) {
node.DestroyQueue(*queue_[ii]);
}
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