diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index dcdc40f..a464a12 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -1091,15 +1091,15 @@ namespace DS4Windows error = string.Empty; cState.CopyTo(pState); - } - lock (eventQueueLock) - { - Action tempAct = null; - for (int actInd = 0, actLen = eventQueue.Count; actInd < actLen; actInd++) + lock (eventQueueLock) { - tempAct = eventQueue.Dequeue(); - tempAct.Invoke(); + Action tempAct = null; + for (int actInd = 0, actLen = eventQueue.Count; actInd < actLen; actInd++) + { + tempAct = eventQueue.Dequeue(); + tempAct.Invoke(); + } } } }