From fb8daa4ed90f0ef340e00f1b912453521a5e6fe3 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 12 Aug 2025 18:12:15 +0800 Subject: [PATCH] Potential race condition in action keyword management --- Flow.Launcher.Core/Plugin/PluginManager.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 37b2660dc..b0624f373 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -648,14 +648,7 @@ namespace Flow.Launcher.Core.Plugin } else { - if (_nonGlobalPlugins.TryGetValue(newActionKeyword, out var item)) - { - _nonGlobalPlugins.TryUpdate(newActionKeyword, plugin, item); - } - else - { - _nonGlobalPlugins.TryAdd(newActionKeyword, plugin); - } + _nonGlobalPlugins.AddOrUpdate(newActionKeyword, plugin, (key, oldValue) => plugin); } // Update action keywords and action keyword in plugin metadata