Skip to content
Permalink
Browse files

Fix segfault when destructing tree while updating

  • Loading branch information...
peak3d committed Jun 13, 2018
1 parent 84df3e6 commit 5756133fd994fa17e6728b03891ac0032a1633d1
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/common/AdaptiveTree.cpp
@@ -64,9 +64,6 @@ namespace adaptive

AdaptiveTree::~AdaptiveTree()
{
for (std::vector<Period*>::const_iterator bp(periods_.begin()), ep(periods_.end()); bp != ep; ++bp)
delete *bp;

has_timeshift_buffer_ = false;
if (updateThread_)
{
@@ -77,6 +74,10 @@ namespace adaptive
updateThread_->join();
delete updateThread_;
}

std::lock_guard<std::mutex> lck(treeMutex_);
for (std::vector<Period*>::const_iterator bp(periods_.begin()), ep(periods_.end()); bp != ep; ++bp)
delete *bp;
}

void AdaptiveTree::FreeSegments(Representation *rep)

0 comments on commit 5756133

Please sign in to comment.
You can’t perform that action at this time.