From 3d47e05ab026c9fff87a37875fc24d444c253aa9 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 19 Jun 2023 20:04:59 +0200 Subject: [PATCH] chore: lock plugin lists when applying profile want state --- Dalamud/Plugin/Internal/PluginManager.cs | 4 ++-- Dalamud/Plugin/Internal/Profiles/ProfileManager.cs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index 907814123..7e16868ad 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -162,7 +162,7 @@ internal partial class PluginManager : IDisposable, IServiceType } /// - /// Gets a list of all available plugins. + /// Gets a copy of the list of all available plugins. /// public IEnumerable AvailablePlugins { @@ -176,7 +176,7 @@ internal partial class PluginManager : IDisposable, IServiceType } /// - /// Gets a list of all plugins with an available update. + /// Gets a copy of the list of all plugins with an available update. /// public IEnumerable UpdatablePlugins { diff --git a/Dalamud/Plugin/Internal/Profiles/ProfileManager.cs b/Dalamud/Plugin/Internal/Profiles/ProfileManager.cs index d91db1283..c996a3f43 100644 --- a/Dalamud/Plugin/Internal/Profiles/ProfileManager.cs +++ b/Dalamud/Plugin/Internal/Profiles/ProfileManager.cs @@ -169,6 +169,9 @@ internal class ProfileManager : IServiceType /// public void ApplyAllWantStates() { + var pm = Service.Get(); + using var pmLock = pm.LockPluginLists(); + this.isBusy = true; Log.Information("Getting want states..."); @@ -185,7 +188,6 @@ internal class ProfileManager : IServiceType Log.Information("Applying want states..."); - var pm = Service.Get(); var tasks = new List(); foreach (var installedPlugin in pm.InstalledPlugins)