From deadc396bc37db36b5c9312d9fce08b90f6f80ad Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 4 Jan 2020 01:08:43 +0000 Subject: [PATCH] Don't deinit SDL before calling an SDL function Also, it's possible for SDL to initialise without 'joystick' being set to a non-NULL value. --- src/Input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Input.cpp b/src/Input.cpp index 83197c65..2e09de12 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -18,10 +18,11 @@ void ReleaseDirectInput(void) // Close opened joystick (if exists) if (joystick != NULL) { - SDL_QuitSubSystem(SDL_INIT_JOYSTICK); SDL_JoystickClose(joystick); joystick = NULL; } + + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); } BOOL HookAllDirectInputDevices(void);