mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
make sure no plugins are lost when deleting a profile
This commit is contained in:
parent
e93e1cc806
commit
2ed215b74b
1 changed files with 6 additions and 0 deletions
|
|
@ -237,6 +237,12 @@ internal class ProfileManager : IServiceType
|
|||
/// <param name="profile">The profile to delete.</param>
|
||||
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)");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue