瀏覽代碼

Fixed infinite loop shutting down WGI controllers

We are guaranteed that the lock will be held during shutdown, so if we are in InvokeRemoved(), it's because we're shutting down controllers and need to remove them from our internal list.

Fixes https://github.com/libsdl-org/SDL/issues/7016
Sam Lantinga 3 年之前
父節點
當前提交
ac99db9fc8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/joystick/windows/SDL_windows_gaming_input.c

+ 1 - 1
src/joystick/windows/SDL_windows_gaming_input.c

@@ -410,7 +410,7 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeRemo
     SDL_LockJoysticks();
     SDL_LockJoysticks();
 
 
     /* Can we get delayed calls to InvokeRemoved() after WGI_JoystickQuit()? */
     /* Can we get delayed calls to InvokeRemoved() after WGI_JoystickQuit()? */
-    if (SDL_JoysticksQuitting() || !SDL_JoysticksInitialized()) {
+    if (!SDL_JoysticksInitialized()) {
         SDL_UnlockJoysticks();
         SDL_UnlockJoysticks();
         return S_OK;
         return S_OK;
     }
     }