From 6db7acca201a0447526f39596afa48fc30a444df Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Sun, 18 Aug 2024 08:18:30 +0900 Subject: [PATCH] Do not throw already unloaded exception on exit --- Dalamud/Plugin/Internal/PluginManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index b42b51525..f390664b6 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -396,7 +396,9 @@ internal class PluginManager : IInternalDisposableService await plugin.UnloadAsync(PluginLoaderDisposalMode.None).SuppressException(); // Unload plugins that can be unloaded from any thread. - await Task.WhenAll(disposablePlugins.Select(plugin => plugin.UnloadAsync(PluginLoaderDisposalMode.None))) + await Task.WhenAll( + disposablePlugins.Where(plugin => plugin.Manifest.CanUnloadAsync) + .Select(plugin => plugin.UnloadAsync(PluginLoaderDisposalMode.None))) .SuppressException(); // Just in case plugins still have tasks running that they didn't cancel when they should have,