Browse Source

Fix tiny memory leak on opening/closing new game window

Find this one when tested huge pack of 5000+ maps. Each time I opened/closed Single Scenario window memory usage was growing for ~1MB.
It's happen because inflateEnd is freed related structures, but not freed inflateState that created outside of zlib code.
ArseniyShestakov 10 years ago
parent
commit
4eed1716d5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/filesystem/CCompressedStream.cpp

+ 1 - 1
lib/filesystem/CCompressedStream.cpp

@@ -103,7 +103,7 @@ CCompressedStream::CCompressedStream(std::unique_ptr<CInputStream> stream, bool
 CCompressedStream::~CCompressedStream()
 {
 	inflateEnd(inflateState);
-	//delete inflateState;
+	delete inflateState;
 }
 
 si64 CCompressedStream::readMore(ui8 *data, si64 size)