Added a clear of allocated Records and the cache's in flt::Registry to
prevent memory leaks and unneccesary references to model models remaining beyond the scope of the loader.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
|
||||
;
|
||||
#include <osg/Node>
|
||||
#include <osg/Group>
|
||||
#include <osg/Notify>
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
using namespace flt;
|
||||
|
||||
// static
|
||||
Registry* Registry::instance()
|
||||
{
|
||||
static Registry s_nodeFactory;
|
||||
@@ -44,6 +43,7 @@ Record* Registry::getPrototype(const int opcode)
|
||||
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -80,3 +80,10 @@ FltFile* Registry::getFltFile(const std::string& name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Registry::clearObjectCache()
|
||||
{
|
||||
_textureMap.clear();
|
||||
_fltFileMap.clear();
|
||||
|
||||
_recordForFutureDeleteList.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user