Skip to content

Commit a9173c8

Browse files
committed
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.
1 parent 521f442 commit a9173c8

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/cleditor/STEPfile.inline.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename, bool
4343
STEPfile::~STEPfile() {
4444
delete _currentDir;
4545

46-
// remove everything from the Registry before deleting it
47-
_headerRegistry->DeleteContents();
4846
delete _headerRegistry;
4947

5048
_headerInstances->DeleteInstances();

src/clstepcore/Registry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SCL_CORE_EXPORT Registry {
3535
all_ents_cnt;
3636
HashEntry cur_entity;
3737
HashEntry cur_schema;
38-
HashEntry cur_type;
38+
HashEntry cur_type;
3939

4040
// used by AddEntity() and RemoveEntity() to deal with renamings of an
4141
// entity done in a USE or REFERENCE clause - see header comments in

src/clstepcore/Registry.inline.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Registry::Registry( CF_init initFunct )
6868
}
6969

7070
Registry::~Registry() {
71+
DeleteContents();
7172
HASHdestroy( primordialSwamp );
7273
HASHdestroy( active_schemas );
7374
HASHdestroy( active_types );

0 commit comments

Comments
 (0)