- fixed a memory leak in the FileReader.

This commit is contained in:
Christoph Oelckers 2018-04-29 19:09:51 +02:00
parent 852c42bbd4
commit 4d72214fd5

View file

@ -348,7 +348,11 @@ public:
bool FileReader::OpenFile(const char *filename, FileReader::Size start, FileReader::Size length) bool FileReader::OpenFile(const char *filename, FileReader::Size start, FileReader::Size length)
{ {
auto reader = new StdFileReader; auto reader = new StdFileReader;
if (!reader->Open(filename, (long)start, (long)length)) return false; if (!reader->Open(filename, (long)start, (long)length))
{
delete reader;
return false;
}
Close(); Close();
mReader = reader; mReader = reader;
return true; return true;