mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 20:52:30 +00:00
Fix mem leak in IfcSpfStream (not closed upon destruction), make Entity's dtor virtual.
This commit is contained in:
@@ -127,6 +127,11 @@ IfcSpfStream::IfcSpfStream(void* data, int l) {
|
|||||||
len = l;
|
len = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IfcSpfStream::~IfcSpfStream()
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
void IfcSpfStream::Close() {
|
void IfcSpfStream::Close() {
|
||||||
#ifdef BUF_SIZE
|
#ifdef BUF_SIZE
|
||||||
if ( paging ) fclose(stream);
|
if ( paging ) fclose(stream);
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ namespace IfcParse {
|
|||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
Entity(unsigned int i, IfcFile* t);
|
Entity(unsigned int i, IfcFile* t);
|
||||||
Entity(unsigned int i, IfcFile* t, unsigned int o);
|
Entity(unsigned int i, IfcFile* t, unsigned int o);
|
||||||
~Entity();
|
virtual ~Entity();
|
||||||
IfcEntityList::ptr getInverse(IfcSchema::Type::Enum type, int attribute_index);
|
IfcEntityList::ptr getInverse(IfcSchema::Type::Enum type, int attribute_index);
|
||||||
void Load(std::vector<unsigned int>& ids, bool seek=false) const;
|
void Load(std::vector<unsigned int>& ids, bool seek=false) const;
|
||||||
Argument* getArgument (unsigned int i);
|
Argument* getArgument (unsigned int i);
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ namespace IfcParse {
|
|||||||
IfcSpfStream(const std::string& fn);
|
IfcSpfStream(const std::string& fn);
|
||||||
IfcSpfStream(std::istream& f, int len);
|
IfcSpfStream(std::istream& f, int len);
|
||||||
IfcSpfStream(void* data, int len);
|
IfcSpfStream(void* data, int len);
|
||||||
|
~IfcSpfStream();
|
||||||
/// Returns the character at the cursor
|
/// Returns the character at the cursor
|
||||||
char Peek();
|
char Peek();
|
||||||
/// Returns the character at specified offset
|
/// Returns the character at specified offset
|
||||||
|
|||||||
Reference in New Issue
Block a user