diff --git a/src/gba/gba.c b/src/gba/gba.c index f074a4696..88d546b10 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -105,6 +105,7 @@ void GBADestroy(struct GBA* gba) { GBAMemoryDeinit(gba); GBAVideoDeinit(&gba->video); GBAAudioDeinit(&gba->audio); + GBASIODeinit(&gba->sio); GBARRContextDestroy(gba); } diff --git a/src/gba/sio.c b/src/gba/sio.c index 4f93e4e21..d1e732492 100644 --- a/src/gba/sio.c +++ b/src/gba/sio.c @@ -59,6 +59,9 @@ void GBASIOInit(struct GBASIO* sio) { } void GBASIODeinit(struct GBASIO* sio) { + if (sio->activeDriver && sio->activeDriver->unload) { + sio->activeDriver->unload(sio->activeDriver); + } if (sio->drivers.multiplayer && sio->drivers.multiplayer->deinit) { sio->drivers.multiplayer->deinit(sio->drivers.multiplayer); }