shithub: cstory

Download patch

ref: deadc396bc37db36b5c9312d9fce08b90f6f80ad
parent: b81023f63cab2a4b827e04188147e5ba345577b6
author: Clownacy <[email protected]>
date: Fri Jan 3 20:08:43 EST 2020

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.

--- a/src/Input.cpp
+++ b/src/Input.cpp
@@ -18,10 +18,11 @@
 	// 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);