This commit is contained in:
Lior Halphon 2021-09-22 20:53:04 +03:00
parent 51be70275d
commit 84c5f8b92d
2 changed files with 2 additions and 0 deletions

View File

@ -412,6 +412,7 @@ int GB_load_gbs_from_buffer(GB_gameboy_t *gb, const uint8_t *buffer, size_t size
if (gb->mbc_ram) { if (gb->mbc_ram) {
free(gb->mbc_ram); free(gb->mbc_ram);
gb->mbc_ram = NULL; gb->mbc_ram = NULL;
gb->mbc_ram_size = 0;
} }
if (gb->cartridge_type->has_ram) { if (gb->cartridge_type->has_ram) {

View File

@ -141,6 +141,7 @@ void GB_configure_cart(GB_gameboy_t *gb)
if (gb->mbc_ram) { if (gb->mbc_ram) {
free(gb->mbc_ram); free(gb->mbc_ram);
gb->mbc_ram = NULL; gb->mbc_ram = NULL;
gb->mbc_ram_size = 0;
} }
if (gb->cartridge_type->has_ram) { if (gb->cartridge_type->has_ram) {