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.
This commit is contained in:
Clownacy 2020-01-04 01:08:43 +00:00
parent b81023f63c
commit deadc396bc

View file

@ -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);