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
- GBA Serialize: Fix memory corruption bug in GBAExtdataSerialize
- GBA Serialize: Fix loading savegames from savestates
- All: Fix several file handle leaks
Misc:
- GBA: Slightly optimize GBAProcessEvents
- Qt: Add preset for DualShock 4

View File

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

View File

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

View File

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

View File

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