소스 검색

Make sure we don't try to use the XInput DLL after it's unloaded

Steam ran into a crash SDL_XINPUT_JoystickDetect() with XINPUTGETCAPABILITIES being NULL. I'm not sure how that happened, and there may still be a race condition if this is a multi-threaded issue, but at least this is more correct.
Sam Lantinga 1 년 전
부모
커밋
0ae4fd0ec9
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/joystick/windows/SDL_xinputjoystick.c

+ 1 - 0
src/joystick/windows/SDL_xinputjoystick.c

@@ -417,6 +417,7 @@ void SDL_XINPUT_JoystickClose(SDL_Joystick *joystick)
 void SDL_XINPUT_JoystickQuit(void)
 {
     if (s_bXInputEnabled) {
+        s_bXInputEnabled = SDL_FALSE;
         WIN_UnloadXInputDLL();
     }
 }