mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Reloading fixed dictionary when clearing memory
This commit is contained in:
@@ -336,7 +336,7 @@ void Memory::loadDataFromDb(bool postInitClosingEvents)
|
||||
}
|
||||
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit(uFormat("Adding word references, done! (%d)", _vwd->getTotalActiveReferences())));
|
||||
|
||||
if(_vwd->getUnusedWordsSize())
|
||||
if(_vwd->getUnusedWordsSize() && _vwd->isIncremental())
|
||||
{
|
||||
UWARN("_vwd->getUnusedWordsSize() must be empty... size=%d", _vwd->getUnusedWordsSize());
|
||||
}
|
||||
|
||||
@@ -586,6 +586,12 @@ void VWDictionary::clear(bool printWarningsIfNotEmpty)
|
||||
_unusedWords.clear();
|
||||
_flannIndex->release();
|
||||
useDistanceL1_ = false;
|
||||
|
||||
if(!_incrementalDictionary)
|
||||
{
|
||||
// reload the fixed dictionary
|
||||
this->setFixedDictionary(_dictionaryPath);
|
||||
}
|
||||
}
|
||||
|
||||
int VWDictionary::getNextId()
|
||||
|
||||
Reference in New Issue
Block a user