Skip to content

Commit

Permalink
Still a problem with eraseNonReal, put this mutex another way
Browse files Browse the repository at this point in the history
  • Loading branch information
cosurgi committed May 1, 2015
1 parent 0a0e677 commit 28d9acf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/InteractionContainer.cpp
Expand Up @@ -130,8 +130,16 @@ void InteractionContainer::requestErase(Interaction* I){
}

void InteractionContainer::eraseNonReal(){
boost::mutex::scoped_lock lock(drawloopmutex);
FOREACH(const shared_ptr<Interaction>& i, *this) if(!i->isReal()) this->erase(i->getId1(),i->getId2(),i->linIx);
FOREACH(const shared_ptr<Interaction>& i, *this)
{
bool isNotReal(false);
{
boost::mutex::scoped_lock lock(drawloopmutex);
isNotReal = not i->isReal();
}
if(isNotReal)
this->erase(i->getId1(),i->getId2(),i->linIx);
}
}

// compare interaction based on their first id
Expand Down

0 comments on commit 28d9acf

Please sign in to comment.