Fixed a bug when switching from BadSignaturesIgnored=false to true (if bad signatures were saved before the switch)

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1070 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-01-22 20:42:14 +00:00
parent b5f74daaea
commit 29d377135e

View File

@@ -1438,8 +1438,8 @@ void Memory::moveToTrash(Signature * s, bool saveToDatabase)
UDEBUG("id=%d", s?s->id():0);
if(s)
{
// If not saved to database or it is a bad signature, remove links!
if(!saveToDatabase || (s->isBadSignature() && _badSignaturesIgnored))
// If not saved to database or it is a bad signature (not saved), remove links!
if(!saveToDatabase || (!s->isSaved() && s->isBadSignature() && _badSignaturesIgnored))
{
UASSERT_MSG(this->isInSTM(s->id()),
uFormat("Deleting location (%d) outside the STM is not implemented!", s->id()).c_str());