From 2ed215b74b3f8be71f69981655dc0328d2123bd7 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 10 Apr 2023 20:14:06 +0200 Subject: [PATCH] make sure no plugins are lost when deleting a profile --- Dalamud/Plugin/Internal/Profiles/ProfileManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dalamud/Plugin/Internal/Profiles/ProfileManager.cs b/Dalamud/Plugin/Internal/Profiles/ProfileManager.cs index 7a8772d74..11214ba08 100644 --- a/Dalamud/Plugin/Internal/Profiles/ProfileManager.cs +++ b/Dalamud/Plugin/Internal/Profiles/ProfileManager.cs @@ -237,6 +237,12 @@ internal class ProfileManager : IServiceType /// The profile to delete. public void DeleteProfile(Profile profile) { + // We need to remove all plugins from the profile first, so that they are re-added to the default profile if needed + foreach (var plugin in profile.Plugins) + { + profile.Remove(plugin.InternalName, false); + } + Debug.Assert(this.config.SavedProfiles!.Remove(profile.Model), "this.config.SavedProfiles!.Remove(profile.Model)"); Debug.Assert(this.profiles.Remove(profile), "this.profiles.Remove(profile)");