All: Fix several file handle leaks

This commit is contained in:
Jeffrey Pfau 2016-03-03 00:04:15 -08:00
parent 8beac67f56
commit 1f204c8eef
5 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,7 @@ Bugfixes:
- Qt: Initialize m_useBios - Qt: Initialize m_useBios
- GBA Serialize: Fix memory corruption bug in GBAExtdataSerialize - GBA Serialize: Fix memory corruption bug in GBAExtdataSerialize
- GBA Serialize: Fix loading savegames from savestates - GBA Serialize: Fix loading savegames from savestates
- All: Fix several file handle leaks
Misc: Misc:
- GBA: Slightly optimize GBAProcessEvents - GBA: Slightly optimize GBAProcessEvents
- Qt: Add preset for DualShock 4 - Qt: Add preset for DualShock 4

View File

@ -120,6 +120,7 @@ void GBUnloadROM(struct GB* gb) {
#ifndef _3DS #ifndef _3DS
gb->romVf->unmap(gb->romVf, gb->pristineRom, gb->pristineRomSize); gb->romVf->unmap(gb->romVf, gb->pristineRom, gb->pristineRomSize);
#endif #endif
gb->romVf->close(gb->romVf);
gb->pristineRom = 0; gb->pristineRom = 0;
gb->romVf = 0; gb->romVf = 0;
} }

View File

@ -125,6 +125,7 @@ void GBAUnloadROM(struct GBA* gba) {
#ifndef _3DS #ifndef _3DS
gba->romVf->unmap(gba->romVf, gba->pristineRom, gba->pristineRomSize); gba->romVf->unmap(gba->romVf, gba->pristineRom, gba->pristineRomSize);
#endif #endif
gba->romVf->close(gba->romVf);
gba->pristineRom = 0; gba->pristineRom = 0;
gba->romVf = 0; gba->romVf = 0;
} }

View File

@ -880,6 +880,7 @@ bool mGLES2ShaderLoad(struct VideoShader* shader, struct VDir* dir) {
} }
} }
} }
manifest->close(manifest);
ConfigurationDeinit(&description); ConfigurationDeinit(&description);
return success; return success;
} }

View File

@ -151,7 +151,9 @@ bool ConfigurationRead(struct Configuration* configuration, const char* path) {
if (!vf) { if (!vf) {
return false; return false;
} }
return ConfigurationReadVFile(configuration, vf); bool res = ConfigurationReadVFile(configuration, vf);
vf->close(vf);
return res;
} }
bool ConfigurationReadVFile(struct Configuration* configuration, struct VFile* vf) { bool ConfigurationReadVFile(struct Configuration* configuration, struct VFile* vf) {