mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
Fixed memory leak in CCompressedStream
This commit is contained in:
parent
71378546c1
commit
63500042e8
@ -103,7 +103,7 @@ CCompressedStream::CCompressedStream(std::unique_ptr<CInputStream> stream, bool
|
||||
CCompressedStream::~CCompressedStream()
|
||||
{
|
||||
inflateEnd(inflateState);
|
||||
delete inflateState;
|
||||
vstd::clear_pointer(inflateState);
|
||||
}
|
||||
|
||||
si64 CCompressedStream::readMore(ui8 *data, si64 size)
|
||||
@ -164,7 +164,7 @@ si64 CCompressedStream::readMore(ui8 *data, si64 size)
|
||||
if (fileEnded)
|
||||
{
|
||||
inflateEnd(inflateState);
|
||||
inflateState = nullptr;
|
||||
vstd::clear_pointer(inflateState);
|
||||
}
|
||||
return decompressed;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user