refactor: make all PluginInterface classes explicitly disposable

This commit is contained in:
goaaats 2022-01-08 03:00:56 +01:00
parent 33f230fa75
commit 2d90598b70
No known key found for this signature in database
GPG key ID: F18F057873895461
16 changed files with 43 additions and 29 deletions

View file

@ -10,6 +10,7 @@ using Dalamud.Logging.Internal;
using Dalamud.Plugin.Internal.Exceptions;
using Dalamud.Plugin.Internal.Loader;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Utility;
namespace Dalamud.Plugin.Internal
{
@ -209,7 +210,7 @@ namespace Dalamud.Plugin.Internal
this.instance?.Dispose();
this.instance = null;
this.DalamudInterface?.Dispose();
this.DalamudInterface?.ExplicitDispose();
this.DalamudInterface = null;
this.pluginType = null;
@ -332,7 +333,7 @@ namespace Dalamud.Plugin.Internal
if (this.instance == null)
{
this.State = PluginState.LoadError;
this.DalamudInterface.Dispose();
this.DalamudInterface.ExplicitDispose();
Log.Error($"Error while loading {this.Name}, failed to bind and call the plugin constructor");
return;
}
@ -382,7 +383,7 @@ namespace Dalamud.Plugin.Internal
this.instance?.Dispose();
this.instance = null;
this.DalamudInterface?.Dispose();
this.DalamudInterface?.ExplicitDispose();
this.DalamudInterface = null;
this.pluginType = null;