From ad40d49720992e7cd09dc265a73fe05ceaed11ad Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 15 Jul 2003 20:41:45 +0000 Subject: [PATCH] Unacquire before calling SetEventNotification. --- .../arch/InputHandler/InputHandler_DirectInput.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp index d87a451f97..bc89f2e73a 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -455,9 +455,12 @@ void InputHandler_DInput::InputThread() } BufferedDevices.push_back( &Devices[i] ); + + IDirectInputDevice2_Unacquire(Devices[i].Device); HRESULT hr = IDirectInputDevice2_SetEventNotification(Devices[i].Device, Handle); if( FAILED(hr) ) LOG->Warn("IDirectInputDevice2_SetEventNotification failed on %i", i); + IDirectInputDevice2_Acquire(Devices[i].Device); } /* If we have any polled devices, we need a fast loop. */ @@ -516,8 +519,13 @@ void InputHandler_DInput::InputThread() VDCHECKPOINT; for( i = 0; i < Devices.size(); ++i ) - if( Devices[i].buffered ) - IDirectInputDevice2_SetEventNotification( Devices[i].Device, NULL ); + { + if( !Devices[i].buffered ) + continue; + + IDirectInputDevice2_Unacquire(Devices[i].Device); + IDirectInputDevice2_SetEventNotification( Devices[i].Device, NULL ); + } CloseHandle(Handle);