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:
Robert Osfield
2003-03-18 20:10:51 +00:00
parent e978c405e1
commit b04edb70aa
9 changed files with 59 additions and 40 deletions

View File

@@ -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();
}