From 80960f9e9aaf22239d0dea06b2ddc18082f21b02 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 27 Feb 2015 01:12:58 -0800 Subject: [PATCH] GBA SIO: Properly deinitialize SIO --- src/gba/gba.c | 1 + src/gba/sio.c | 3 +++ 2 files changed, 4 insertions(+) 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); }