mirror of https://github.com/mgba-emu/mgba.git
GBA: Fix leak if attempting to load BIOS multiple times
This commit is contained in:
parent
5b319cfd91
commit
39203a0daf
1
CHANGES
1
CHANGES
|
@ -39,6 +39,7 @@ Other fixes:
|
|||
- FFmpeg: Fix some small memory leaks
|
||||
- FFmpeg: Fix encoding of time base
|
||||
- GB Core: Fix extracting SRAM when none is present
|
||||
- GBA: Fix leak if attempting to load BIOS multiple times
|
||||
- GBA Savedata: Fix extracting save when not yet configured in-game
|
||||
- Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642)
|
||||
- Qt: Fix static compilation in MinGW (fixes mgba.io/i/1769)
|
||||
|
|
|
@ -443,7 +443,6 @@ void GBAYankROM(struct GBA* gba) {
|
|||
}
|
||||
|
||||
void GBALoadBIOS(struct GBA* gba, struct VFile* vf) {
|
||||
gba->biosVf = vf;
|
||||
if (vf->size(vf) != SIZE_BIOS) {
|
||||
mLOG(GBA, WARN, "Incorrect BIOS size");
|
||||
return;
|
||||
|
@ -453,6 +452,11 @@ void GBALoadBIOS(struct GBA* gba, struct VFile* vf) {
|
|||
mLOG(GBA, WARN, "Couldn't map BIOS");
|
||||
return;
|
||||
}
|
||||
if (gba->biosVf) {
|
||||
gba->biosVf->unmap(gba->biosVf, gba->memory.bios, SIZE_BIOS);
|
||||
gba->biosVf->close(gba->biosVf);
|
||||
}
|
||||
gba->biosVf = vf;
|
||||
gba->memory.bios = bios;
|
||||
gba->memory.fullBios = 1;
|
||||
uint32_t checksum = GBAChecksum(gba->memory.bios, SIZE_BIOS);
|
||||
|
|
Loading…
Reference in New Issue