Moved Registry::DeleteContents to Registry::~Registry.

* DeleteContents was only called for _headerRegistry, not for the Schema
  Registry, by moving it to the destructor this fixes a number of memory
  leaks.
This commit is contained in:
davyw
2012-04-05 20:40:02 +02:00
parent 521f4427ea
commit a9173c8b41
3 changed files with 2 additions and 3 deletions
-2
View File
@@ -43,8 +43,6 @@ STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename, bool
STEPfile::~STEPfile() {
delete _currentDir;
// remove everything from the Registry before deleting it
_headerRegistry->DeleteContents();
delete _headerRegistry;
_headerInstances->DeleteInstances();
+1 -1
View File
@@ -35,7 +35,7 @@ class SCL_CORE_EXPORT Registry {
all_ents_cnt;
HashEntry cur_entity;
HashEntry cur_schema;
HashEntry cur_type;
HashEntry cur_type;
// used by AddEntity() and RemoveEntity() to deal with renamings of an
// entity done in a USE or REFERENCE clause - see header comments in
+1
View File
@@ -68,6 +68,7 @@ Registry::Registry( CF_init initFunct )
}
Registry::~Registry() {
DeleteContents();
HASHdestroy( primordialSwamp );
HASHdestroy( active_schemas );
HASHdestroy( active_types );