mirror of https://github.com/mgba-emu/mgba.git
Core: Fix patch autoloading leaking the file handle
This commit is contained in:
parent
eaf45b9ab8
commit
4ef98c7ddf
1
CHANGES
1
CHANGES
|
@ -24,6 +24,7 @@ Emulation fixes:
|
|||
- GBA Video: Improve emulation of window start/end conditions (fixes mgba.io/i/1945)
|
||||
Other fixes:
|
||||
- Core: Fix inconsistencies with setting game-specific overrides (fixes mgba.io/i/2963)
|
||||
- Core: Fix patch autoloading leaking the file handle
|
||||
- Debugger: Fix writing to specific segment in command-line debugger
|
||||
- GB: Fix uninitialized save data when loading undersized temporary saves
|
||||
- GB, GBA Core: Fix memory leak if reloading debug symbols
|
||||
|
|
|
@ -239,9 +239,22 @@ bool mCoreAutoloadPatch(struct mCore* core) {
|
|||
if (!core->dirs.patch) {
|
||||
return false;
|
||||
}
|
||||
return core->loadPatch(core, mDirectorySetOpenSuffix(&core->dirs, core->dirs.patch, ".ups", O_RDONLY)) ||
|
||||
core->loadPatch(core, mDirectorySetOpenSuffix(&core->dirs, core->dirs.patch, ".ips", O_RDONLY)) ||
|
||||
core->loadPatch(core, mDirectorySetOpenSuffix(&core->dirs, core->dirs.patch, ".bps", O_RDONLY));
|
||||
struct VFile* vf = NULL;
|
||||
if (!vf) {
|
||||
vf = mDirectorySetOpenSuffix(&core->dirs, core->dirs.patch, ".bps", O_RDONLY);
|
||||
}
|
||||
if (!vf) {
|
||||
vf = mDirectorySetOpenSuffix(&core->dirs, core->dirs.patch, ".ups", O_RDONLY);
|
||||
}
|
||||
if (!vf) {
|
||||
vf = mDirectorySetOpenSuffix(&core->dirs, core->dirs.patch, ".ips", O_RDONLY);
|
||||
}
|
||||
if (!vf) {
|
||||
return false;
|
||||
}
|
||||
bool result = core->loadPatch(core, vf);
|
||||
vf->close(vf);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool mCoreAutoloadCheats(struct mCore* core) {
|
||||
|
|
Loading…
Reference in New Issue