COMMON: Fix _disposeFileHandle not being set

If there is a file handle, the clear() method checks if it should be
disposed of. However, the _disposeFileHandle variable was never set, so
it's unlikely that _exe was ever deleted. I found this out from a
Valgrind warning when quitting Buried in Time.

This seems like a very obvious fix to me, and as such it seems like a
good candidate for backporting to the release branch. On the other hand,
maybe there are cases where it worked by sheer, dumb luck? I'm not
familiar enough with where and how it is used.
This commit is contained in:
Torbjörn Andersson 2021-09-06 08:01:08 +02:00 committed by Eugene Sandulenko
parent bebded6d3c
commit 92a2519846
No known key found for this signature in database
GPG key ID: 014D387312D34F08

View file

@ -52,6 +52,7 @@ bool NEResources::loadFromEXE(SeekableReadStream *stream, DisposeAfterUse::Flag
return false;
_exe = stream;
_disposeFileHandle = disposeFileHandle;
uint32 offsetResourceTable = getResourceTableOffset();
if (offsetResourceTable == 0xFFFFFFFF)