Don't close controller after SDL has quit (#642)

* Don't close controller after SDL has quit

* Don't check if controller can rumble if null
This commit is contained in:
Sirius902
2022-07-10 18:40:00 -07:00
committed by GitHub
parent 926fd3f406
commit e3267a4e9b

View File

@@ -101,10 +101,10 @@ namespace Ship {
}
bool SDLController::Close() {
if (CanRumble()) {
SDL_GameControllerRumble(Cont, 0, 0, 0);
}
if (Cont != nullptr) {
if (Cont != nullptr && SDL_WasInit(SDL_INIT_GAMECONTROLLER)) {
if (CanRumble()) {
SDL_GameControllerRumble(Cont, 0, 0, 0);
}
SDL_GameControllerClose(Cont);
}
Cont = nullptr;