I ran into a problem using the Popup watchers. If i start one or more, then use StopAllPopupWatchers to kill them all, they are killed, but their keys remain in the watchers-class. Trying to reinstate that Popupwatcher later will result in an error, because the key is already in the dict.
The StopPopupWatcher has a line that does watchers.Remove(key);
but the StopAllPopupWatchers doesn't.
So i adapted the code to:
Code: Select all
foreach (var watcherpair in watchers)
{
var watcher = watcherpair.Value;
string key = watcherpair.Key;
watcher.Clear();
watcher.Stop();
Report.Info("Popup watcher " + key + " stopped.");
}
watchers.Clear();