Do not prematurely close unzFiles for ips, properly close for ups

(closes #343)
This commit is contained in:
OV2 2018-06-19 22:33:23 +02:00
parent f2c9386f9f
commit af3dbf8b54
1 changed files with 8 additions and 6 deletions

View File

@ -4254,13 +4254,14 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
Stream *s = new unzStream(file);
ret = ReadBPSPatch(s, offset, rom_size);
s->closeStream();
delete s;
if (ret)
printf("!\n");
else
printf(" failed!\n");
}
assert(unzClose(file) == UNZ_OK);
}
}
#endif
@ -4318,13 +4319,14 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
Stream *s = new unzStream(file);
ret = ReadUPSPatch(s, offset, rom_size);
s->closeStream();
delete s;
if (ret)
printf("!\n");
else
printf(" failed!\n");
}
assert(unzClose(file) == UNZ_OK);
}
}
#endif
@ -4489,7 +4491,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
Stream *s = new unzStream(file);
ret = ReadIPSPatch(s, offset, rom_size);
s->closeStream();
delete s;
if (ret)
{
@ -4517,7 +4519,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
Stream *s = new unzStream(file);
ret = ReadIPSPatch(s, offset, rom_size);
s->closeStream();
delete s;
if (ret)
{
@ -4552,7 +4554,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
Stream *s = new unzStream(file);
ret = ReadIPSPatch(s, offset, rom_size);
s->closeStream();
delete s;
if (ret)
{
@ -4585,7 +4587,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
Stream *s = new unzStream(file);
ret = ReadIPSPatch(s, offset, rom_size);
s->closeStream();
delete s;
if (ret)
{