mirror of https://github.com/snes9xgit/snes9x.git
Do not prematurely close unzFiles for ips, properly close for ups
(closes #343)
This commit is contained in:
parent
f2c9386f9f
commit
af3dbf8b54
14
memmap.cpp
14
memmap.cpp
|
@ -4254,13 +4254,14 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
|
||||||
|
|
||||||
Stream *s = new unzStream(file);
|
Stream *s = new unzStream(file);
|
||||||
ret = ReadBPSPatch(s, offset, rom_size);
|
ret = ReadBPSPatch(s, offset, rom_size);
|
||||||
s->closeStream();
|
delete s;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
printf("!\n");
|
printf("!\n");
|
||||||
else
|
else
|
||||||
printf(" failed!\n");
|
printf(" failed!\n");
|
||||||
}
|
}
|
||||||
|
assert(unzClose(file) == UNZ_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -4318,13 +4319,14 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
|
||||||
|
|
||||||
Stream *s = new unzStream(file);
|
Stream *s = new unzStream(file);
|
||||||
ret = ReadUPSPatch(s, offset, rom_size);
|
ret = ReadUPSPatch(s, offset, rom_size);
|
||||||
s->closeStream();
|
delete s;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
printf("!\n");
|
printf("!\n");
|
||||||
else
|
else
|
||||||
printf(" failed!\n");
|
printf(" failed!\n");
|
||||||
}
|
}
|
||||||
|
assert(unzClose(file) == UNZ_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -4489,7 +4491,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
|
||||||
|
|
||||||
Stream *s = new unzStream(file);
|
Stream *s = new unzStream(file);
|
||||||
ret = ReadIPSPatch(s, offset, rom_size);
|
ret = ReadIPSPatch(s, offset, rom_size);
|
||||||
s->closeStream();
|
delete s;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
@ -4517,7 +4519,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
|
||||||
|
|
||||||
Stream *s = new unzStream(file);
|
Stream *s = new unzStream(file);
|
||||||
ret = ReadIPSPatch(s, offset, rom_size);
|
ret = ReadIPSPatch(s, offset, rom_size);
|
||||||
s->closeStream();
|
delete s;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
@ -4552,7 +4554,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
|
||||||
|
|
||||||
Stream *s = new unzStream(file);
|
Stream *s = new unzStream(file);
|
||||||
ret = ReadIPSPatch(s, offset, rom_size);
|
ret = ReadIPSPatch(s, offset, rom_size);
|
||||||
s->closeStream();
|
delete s;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
@ -4585,7 +4587,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
|
||||||
|
|
||||||
Stream *s = new unzStream(file);
|
Stream *s = new unzStream(file);
|
||||||
ret = ReadIPSPatch(s, offset, rom_size);
|
ret = ReadIPSPatch(s, offset, rom_size);
|
||||||
s->closeStream();
|
delete s;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue