mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 04:20:34 +00:00
- fixed a memory leak in the FileReader.
(cherry picked from commit 4d72214fd5
)
This commit is contained in:
parent
56b0e9627c
commit
9415b86e37
1 changed files with 5 additions and 1 deletions
|
@ -350,7 +350,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;
|
||||||
|
|
Loading…
Reference in a new issue