From 00868c81477e171658e4e5264478a1983d29457c Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sun, 7 Oct 2018 18:58:00 +0200 Subject: [PATCH] Ref T391, temp. workaround to avoid shutdown crash --- src/blackinput/win/joystickwindows.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/blackinput/win/joystickwindows.cpp b/src/blackinput/win/joystickwindows.cpp index a7dcecc30..383e126ad 100644 --- a/src/blackinput/win/joystickwindows.cpp +++ b/src/blackinput/win/joystickwindows.cpp @@ -172,15 +172,17 @@ namespace BlackInput void ReleaseDirectInput(IDirectInput8 *obj) { - if (obj) { obj->Release(); } - }; + Q_UNUSED(obj); + //! \todo temp workaround for crash when shutting down T391 + // if (obj) { obj->Release(); } + } HRESULT CJoystickWindows::initDirectInput() { IDirectInput8 *directInput = nullptr; // HRESULT hr = DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, IID_IDirectInput8, reinterpret_cast(&directInput), nullptr); HRESULT hr = CoCreateInstance(CLSID_DirectInput8, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectInput8, reinterpret_cast(&directInput)); - if(FAILED(hr)) { return hr; } + if (FAILED(hr)) { return hr; } m_directInput = DirectInput8Ptr(directInput, ReleaseDirectInput); HINSTANCE instance = GetModuleHandle(nullptr);