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:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -68,6 +68,7 @@ Registry::Registry( CF_init initFunct )
|
||||
}
|
||||
|
||||
Registry::~Registry() {
|
||||
DeleteContents();
|
||||
HASHdestroy( primordialSwamp );
|
||||
HASHdestroy( active_schemas );
|
||||
HASHdestroy( active_types );
|
||||
|
||||
Reference in New Issue
Block a user