mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 03:14:23 +00:00
Fix memory leak for HeaderEntity instances:
the getArgumentCount() call in IfcEntityInstanceData destructor isn't virtually dispatched so it returns 0 instead of correct number of arguments => memory leak added IfcEntityInstanceData::clearArguments() which clears all arguments and resets the attributes_ field to nullptr Remove unnecessary copy in IfcEntityInstanceData::setArgument() when argument is created at the call site (no more leak of original argument) Fix memory leak in IfcFile: delete entities from both byid and entity_file_map
This commit is contained in:
committed by
Thomas Krijnen
parent
e677355438
commit
e5b3455533
@@ -66,8 +66,8 @@ public:
|
||||
|
||||
Argument* getArgument(size_t i) const;
|
||||
|
||||
// NB: This makes a copy of the argument
|
||||
void setArgument(size_t i, Argument* a, IfcUtil::ArgumentType attr_type = IfcUtil::Argument_UNKNOWN);
|
||||
// NB: This makes a copy of the argument if make_copy is set
|
||||
void setArgument(size_t i, Argument* a, IfcUtil::ArgumentType attr_type = IfcUtil::Argument_UNKNOWN, bool make_copy = false);
|
||||
|
||||
virtual size_t getArgumentCount() const {
|
||||
if (type_ == 0) {
|
||||
@@ -80,6 +80,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void clearArguments();
|
||||
|
||||
const IfcParse::declaration* type() const {
|
||||
return type_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user