From 9299a3e796719c25c40adcc1eb7c33f392f47437 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 21 Feb 2022 16:24:45 -0800 Subject: [PATCH] Workaround for crash in CoUninitialize() --- src/joystick/windows/SDL_dinputjoystick.c | 3 ++- src/joystick/windows/SDL_rawinputjoystick.c | 3 ++- src/joystick/windows/SDL_windowsjoystick.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c index c2f53a93f..caf627a6c 100644 --- a/src/joystick/windows/SDL_dinputjoystick.c +++ b/src/joystick/windows/SDL_dinputjoystick.c @@ -1147,7 +1147,8 @@ SDL_DINPUT_JoystickQuit(void) } if (coinitialized) { - WIN_CoUninitialize(); + /* Workaround for CoUninitialize() crash in NotifyInitializeSpied() */ + /*WIN_CoUninitialize();*/ coinitialized = SDL_FALSE; } } diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index e63c747ee..c4de681ad 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -657,7 +657,8 @@ RAWINPUT_QuitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_Release(wgi_state.gamepad_statics); wgi_state.gamepad_statics = NULL; } - WIN_CoUninitialize(); + /* Workaround for CoUninitialize() crash in NotifyInitializeSpied() */ + /*WIN_CoUninitialize();*/ wgi_state.initialized = SDL_FALSE; } } diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c index 7dae16d9f..35a4e9c6d 100644 --- a/src/joystick/windows/SDL_windowsjoystick.c +++ b/src/joystick/windows/SDL_windowsjoystick.c @@ -256,7 +256,8 @@ SDL_CleanupDeviceNotification(SDL_DeviceNotificationData *data) UnregisterClass(data->wincl.lpszClassName, data->wincl.hInstance); if (data->coinitialized == S_OK) { - WIN_CoUninitialize(); + /* Workaround for CoUninitialize() crash in NotifyInitializeSpied() */ + /*WIN_CoUninitialize();*/ } }