diff --git a/IPA.Loader/Config/ConfigRuntime.cs b/IPA.Loader/Config/ConfigRuntime.cs index ea80b635..ac1ab542 100644 --- a/IPA.Loader/Config/ConfigRuntime.cs +++ b/IPA.Loader/Config/ConfigRuntime.cs @@ -28,8 +28,8 @@ namespace IPA.Config private static readonly AutoResetEvent configsChangedWatcher = new AutoResetEvent(false); private static readonly ConcurrentDictionary watchers = new ConcurrentDictionary(new DirInfoEqComparer()); - private static readonly ConditionalWeakTable> watcherTrackConfigs - = new ConditionalWeakTable>(); + private static readonly ConcurrentDictionary> watcherTrackConfigs + = new ConcurrentDictionary>(); private static SingleThreadTaskScheduler loadScheduler = null; private static TaskFactory loadFactory = null; private static Thread saveThread = null; @@ -99,7 +99,7 @@ namespace IPA.Config watcher.EnableRaisingEvents = false; // disable while we do shit - var bag = watcherTrackConfigs.GetOrCreateValue(watcher); + var bag = watcherTrackConfigs.GetOrAdd(watcher, w => new ConcurrentBag()); // we don't need to check containment because this function will only be called once per config ever bag.Add(config);