orbitusii / loki-bms-csharp

Battle Management Scope for DCS World (and maybe others?), this time in C#!
MIT License
2 stars 0 forks source link

BUG - System.InvalidOperationException thrown in System.Private.CoreLib.dll during TrackDatabase.PurgeOldData #33

Open orbitusii opened 8 months ago

orbitusii commented 8 months ago

Specifically on line 280, the LiveTracks collection keeps getting modified, as expected, but this leads to some shenanigans as the Database itself is trying to accomplish other tasks on that collection. I presume this also happens on the other two collections, which means my Lock() calls aren't useful or sane.

What likely needs to happen is a whole refactoring of how the TrackDatabase does things - set up a queue for change processing and only make those changes at specific times to avoid modifying the collections EXCEPT when absolutely required.