Fix use after free with GBASIODeinit (#374)

This commit is contained in:
Dwayne Slater 2016-09-04 17:27:13 -04:00 committed by endrift
parent 7e9f43a9c9
commit d7f09a330b
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ void GBASIOSetDriver(struct GBASIO* sio, struct GBASIODriver* driver, enum GBASI
}
}
}
if (sio->mode == mode) {
if (sio->activeDriver == *driverLoc) {
sio->activeDriver = driver;
if (driver && driver->load) {
driver->load(driver);