diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 523ef496f6..6bc8d027bc 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -37,6 +37,8 @@ void InputFilter::ButtonPressed( DeviceInput di, bool Down ) m_fSecsHeld[di.device][di.button] = 0; InputEventType iet = Down? IET_FIRST_PRESS:IET_RELEASE; + + LockMut(queuemutex); queue.push_back( InputEvent(di,iet) ); } @@ -51,6 +53,10 @@ void InputFilter::Update(float fDeltaTime) { INPUTMAN->Update( fDeltaTime ); + /* Make sure that nothing gets inserted while we do this, to prevent + * things like "key pressed, key release, key repeat". */ + LockMut(queuemutex); + for( int d=0; d