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

ScopeRenderer encounters exception from modified collection when trying to redraw because Database was simultaneously updated #1

Closed orbitusii closed 1 year ago

orbitusii commented 1 year ago

when using measure line, app crashed- exception was from ScopeRenderer complaining that a referenced collection was modified while repainting. Probably trying to draw things repeatedly when the Database updates them (esp. removing old source data).

Fix: either lock the relevant collections while drawing or make them thread-safe with the relevant collections (i.e. ConcurrentDictionary or SynchronizedCollection)

orbitusii commented 1 year ago

Fixed with Commit https://github.com/orbitusii/loki-bms-csharp/commit/de6d5c78e784f01d39b0cca940b123efcff309aa