mirror of https://github.com/bsnes-emu/bsnes.git
Fix memory leak
This commit is contained in:
parent
328e2d9e40
commit
39c71b40e7
|
@ -126,6 +126,11 @@ void GB_configure_cart(GB_gameboy_t *gb)
|
|||
GB_log(gb, "Cartridge type %02x is not yet supported.\n", gb->rom[0x147]);
|
||||
}
|
||||
|
||||
if (gb->mbc_ram) {
|
||||
free(gb->mbc_ram);
|
||||
gb->mbc_ram = NULL;
|
||||
}
|
||||
|
||||
if (gb->cartridge_type->has_ram) {
|
||||
if (gb->cartridge_type->mbc_type == GB_MBC2) {
|
||||
gb->mbc_ram_size = 0x200;
|
||||
|
|
Loading…
Reference in New Issue