Destroy DirectInput helper window during shutdown

This commit is contained in:
Roland Winklmeier
2018-10-15 12:12:17 +02:00
committed by Klaus Basan
parent 294b854ed8
commit 4b3d3bba48
2 changed files with 17 additions and 0 deletions

View File

@@ -168,6 +168,7 @@ namespace BlackInput
m_joystickDevices.clear();
m_directInput.reset();
CoUninitialize();
destroyHelperWindow();
}
void ReleaseDirectInput(IDirectInput8 *obj)
@@ -252,6 +253,19 @@ namespace BlackInput
return 0;
}
void CJoystickWindows::destroyHelperWindow()
{
HINSTANCE hInstance = GetModuleHandle(nullptr);
if (helperWindow == nullptr) { return; }
DestroyWindow(helperWindow);
helperWindow = nullptr;
UnregisterClass(helperWindowClassName, hInstance);
helperWindowClass = 0;
}
void CJoystickWindows::addJoystickDevice(const DIDEVICEINSTANCE *pdidInstance)
{
CJoystickDevice *device = new CJoystickDevice(m_directInput, pdidInstance, this);