fixed lastSignature set to loop closure child instead of neighbor

This commit is contained in:
Mathieu Labbe
2015-03-19 17:16:23 -04:00
parent b518edf6ce
commit fe06b34399

View File

@@ -1523,13 +1523,13 @@ void Memory::moveToTrash(Signature * s, bool saveToDatabase, std::list<int> * de
}
// child
if(iter->second.type() > Link::kNeighbor && s->id() > sTo->id())
if(iter->second.type() == Link::kGlobalClosure && s->id() > sTo->id())
{
sTo->setWeight(sTo->getWeight() + s->getWeight()); // copy weight
}
sTo->removeLink(s->id());
if(s == _lastSignature)
if(s == _lastSignature && iter->second.type() == Link::kNeighbor)
{
_lastSignature = sTo;
}