mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Clean up empty plugin lists from _nonGlobalPlugins
After removing plugins, also remove dictionary entries if their associated lists become empty. This prevents unused empty lists from accumulating and keeps the plugin manager's state clean.
This commit is contained in:
parent
2529efeed1
commit
4537013cde
1 changed files with 10 additions and 0 deletions
|
|
@ -816,6 +816,11 @@ namespace Flow.Launcher.Core.Plugin
|
|||
lock (plugins)
|
||||
{
|
||||
plugins.RemoveAll(p => p.Metadata.ID == id);
|
||||
|
||||
if (plugins.Count == 0)
|
||||
{
|
||||
_nonGlobalPlugins.TryRemove(new KeyValuePair<string, List<PluginPair>>(oldActionkeyword, plugins));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1081,6 +1086,11 @@ namespace Flow.Launcher.Core.Plugin
|
|||
lock (entry.Value)
|
||||
{
|
||||
entry.Value.RemoveAll(p => p.Metadata.ID == plugin.ID);
|
||||
|
||||
if (entry.Value.Count == 0)
|
||||
{
|
||||
_nonGlobalPlugins.TryRemove(entry.Key, out var __);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue