mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 14:27:45 +01:00
refactor: make all PluginInterface classes explicitly disposable
This commit is contained in:
parent
33f230fa75
commit
2d90598b70
16 changed files with 43 additions and 29 deletions
|
|
@ -15,6 +15,7 @@ using Dalamud.Game.Network.Internal;
|
|||
using Dalamud.Hooking;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.IoC.Internal;
|
||||
using Dalamud.Utility;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Game.ClientState
|
||||
|
|
@ -136,11 +137,11 @@ namespace Dalamud.Game.ClientState
|
|||
/// <summary>
|
||||
/// Dispose of managed and unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.setupTerritoryTypeHook.Dispose();
|
||||
Service<Condition>.Get().Dispose();
|
||||
Service<GamepadState>.Get().Dispose();
|
||||
Service<Condition>.Get().ExplicitDispose();
|
||||
Service<GamepadState>.Get().ExplicitDispose();
|
||||
Service<Framework>.Get().Update -= this.FrameworkOnOnUpdateEvent;
|
||||
Service<NetworkHandlers>.Get().CfPop -= this.NetworkHandlersOnCfPop;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ namespace Dalamud.Game.ClientState.Conditions
|
|||
/// <summary>
|
||||
/// Disposes this instance, alongside its hooks.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
this.Dispose(true);
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ namespace Dalamud.Game.ClientState.GamePad
|
|||
/// <summary>
|
||||
/// Disposes this instance, alongside its hooks.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
|
|
|
|||
|
|
@ -135,10 +135,10 @@ namespace Dalamud.Game
|
|||
/// <summary>
|
||||
/// Dispose of managed and unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
Service<GameGui>.GetNullable()?.Dispose();
|
||||
Service<GameNetwork>.GetNullable()?.Dispose();
|
||||
Service<GameGui>.GetNullable()?.ExplicitDispose();
|
||||
Service<GameNetwork>.GetNullable()?.ExplicitDispose();
|
||||
|
||||
this.updateHook?.Disable();
|
||||
this.destroyHook?.Disable();
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ namespace Dalamud.Game.Gui
|
|||
/// <summary>
|
||||
/// Dispose of managed and unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.printMessageHook.Dispose();
|
||||
this.populateItemLinkHook.Dispose();
|
||||
|
|
|
|||
|
|
@ -444,12 +444,12 @@ namespace Dalamud.Game.Gui
|
|||
/// <summary>
|
||||
/// Disables the hooks and submodules of this module.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
Service<ChatGui>.Get().Dispose();
|
||||
Service<ToastGui>.Get().Dispose();
|
||||
Service<FlyTextGui>.Get().Dispose();
|
||||
Service<PartyFinderGui>.Get().Dispose();
|
||||
Service<ChatGui>.Get().ExplicitDispose();
|
||||
Service<ToastGui>.Get().ExplicitDispose();
|
||||
Service<FlyTextGui>.Get().ExplicitDispose();
|
||||
Service<PartyFinderGui>.Get().ExplicitDispose();
|
||||
this.setGlobalBgmHook.Dispose();
|
||||
this.handleItemHoverHook.Dispose();
|
||||
this.handleItemOutHook.Dispose();
|
||||
|
|
|
|||
|
|
@ -61,9 +61,9 @@ namespace Dalamud.Game.Gui.PartyFinder
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose of m anaged and unmanaged resources.
|
||||
/// Dispose of managed and unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.receiveListingHook.Dispose();
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ namespace Dalamud.Game.Gui.Toast
|
|||
/// <summary>
|
||||
/// Disposes of managed and unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.showNormalToastHook.Dispose();
|
||||
this.showQuestToastHook.Dispose();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace Dalamud.Game.Network
|
|||
/// <summary>
|
||||
/// Dispose of managed and unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
this.processZonePacketDownHook.Dispose();
|
||||
this.processZonePacketUpHook.Dispose();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue