Fix: Close leak.
- closes https://github.com/assimp/assimp/issues/3416kimkulling/close_memleak-issue-3416
parent
ea7321aae2
commit
1eb2c124a0
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2022, assimp team
|
Copyright (c) 2006-2023, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -66,11 +65,7 @@ namespace Assimp {
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
class MemoryIOStream : public IOStream {
|
class MemoryIOStream : public IOStream {
|
||||||
public:
|
public:
|
||||||
MemoryIOStream (const uint8_t* buff, size_t len, bool own = false)
|
MemoryIOStream (const uint8_t* buff, size_t len, bool own = false) : buffer (buff), length(len), pos((size_t)0), own(own) {
|
||||||
: buffer (buff)
|
|
||||||
, length(len)
|
|
||||||
, pos((size_t)0)
|
|
||||||
, own(own) {
|
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +157,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Destructor. */
|
/** Destructor. */
|
||||||
~MemoryIOSystem() = default;
|
~MemoryIOSystem() {
|
||||||
|
for (auto &it : created_streams) {
|
||||||
|
MemoryIOSystem::Close(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Tests for the existence of a file at the given path. */
|
/** Tests for the existence of a file at the given path. */
|
||||||
|
|
Loading…
Reference in New Issue