microsoft / MIEngine

The Visual Studio MI Debug Engine ("MIEngine") provides an open-source Visual Studio Debugger extension that works with MI-enabled debuggers such as gdb and lldb.
MIT License
818 stars 218 forks source link

Fix race on stopping monitor #1377

Closed WardenGnaw closed 1 year ago

WardenGnaw commented 1 year ago

This PR fixes the race condition when disposing of the RegistryMonitor and when detecting the stop.

This PR modifies Dispose to call Stop() which will cause the wait handler to fire and stop the Monitor thread which will properly dispose of the object.