Closed smurphster closed 3 years ago
Since that code is multi-threaded, I bet one thread modified the collection while the other was in the foreach loop.
That is 100% what happened, maybe just make a copy and run the enumeration on that...
Should be a non-issue now, but reopen if it reoccurs
I was really messing around with multiple sliders at once and caused this exception. Probably would never happen under normal conditions but figured if it's easy to fix, we might as well. I'll take a look at it tomorrow if you don't get to it first.
System.InvalidOperationException HResult=0x80131509 Message=Collection was modified; enumeration operation may not execute. Source=mscorlib StackTrace: at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext() at nanoKontrol2OBS.Kontrol2OBS.EventClock.<>c__DisplayClass3_0.<.ctor>b__0() in C:\Users\devil\source\repos\OBSKorgNanokontrol22\OBSMidi\nanoKontrol2OBS\EventClock.cs:line 32 at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()