GBA SIO: Properly deinitialize SIO

This commit is contained in:
Jeffrey Pfau 2015-02-27 01:12:58 -08:00
parent a5a7ace86e
commit 8112ffdabc
2 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,7 @@ void GBADestroy(struct GBA* gba) {
GBAMemoryDeinit(gba); GBAMemoryDeinit(gba);
GBAVideoDeinit(&gba->video); GBAVideoDeinit(&gba->video);
GBAAudioDeinit(&gba->audio); GBAAudioDeinit(&gba->audio);
GBASIODeinit(&gba->sio);
GBARRContextDestroy(gba); GBARRContextDestroy(gba);
} }

View File

@ -59,6 +59,9 @@ void GBASIOInit(struct GBASIO* sio) {
} }
void GBASIODeinit(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) { if (sio->drivers.multiplayer && sio->drivers.multiplayer->deinit) {
sio->drivers.multiplayer->deinit(sio->drivers.multiplayer); sio->drivers.multiplayer->deinit(sio->drivers.multiplayer);
} }