From 09eccffc385c91a9e2451467e1f4f8719fd70fcf Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sun, 8 Dec 2019 01:06:09 -0600 Subject: [PATCH] Switched away form ConditionalWeakTable to support Net3 --- IPA.Loader/Config/ConfigRuntime.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);