mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Nullify Scoped Service Delegates
This commit is contained in:
parent
b0986a5225
commit
c305c01dfd
9 changed files with 27 additions and 1 deletions
|
|
@ -189,6 +189,8 @@ internal class ConditionPluginScoped : IDisposable, IServiceType, ICondition
|
|||
public void Dispose()
|
||||
{
|
||||
this.conditionService.ConditionChange -= this.ConditionChangedForward;
|
||||
|
||||
this.ConditionChange = null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -210,6 +210,11 @@ internal class DutyStatePluginScoped : IDisposable, IServiceType, IDutyState
|
|||
this.dutyStateService.DutyWiped -= this.DutyWipedForward;
|
||||
this.dutyStateService.DutyRecommenced -= this.DutyRecommencedForward;
|
||||
this.dutyStateService.DutyCompleted -= this.DutyCompletedForward;
|
||||
|
||||
this.DutyStarted = null;
|
||||
this.DutyWiped = null;
|
||||
this.DutyRecommenced = null;
|
||||
this.DutyCompleted = null;
|
||||
}
|
||||
|
||||
private void DutyStartedForward(object sender, ushort territoryId) => this.DutyStarted?.Invoke(sender, territoryId);
|
||||
|
|
|
|||
|
|
@ -460,6 +460,11 @@ internal class ChatGuiPluginScoped : IDisposable, IServiceType, IChatGui
|
|||
this.chatGuiService.CheckMessageHandled -= this.OnCheckMessageForward;
|
||||
this.chatGuiService.ChatMessageHandled -= this.OnMessageHandledForward;
|
||||
this.chatGuiService.ChatMessageUnhandled -= this.OnMessageUnhandledForward;
|
||||
|
||||
this.ChatMessage = null;
|
||||
this.CheckMessageHandled = null;
|
||||
this.ChatMessageHandled = null;
|
||||
this.ChatMessageUnhandled = null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -307,6 +307,8 @@ internal class FlyTextGuiPluginScoped : IDisposable, IServiceType, IFlyTextGui
|
|||
public void Dispose()
|
||||
{
|
||||
this.flyTextGuiService.FlyTextCreated -= this.FlyTextCreatedForward;
|
||||
|
||||
this.FlyTextCreated = null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -566,6 +566,10 @@ internal class GameGuiPluginScoped : IDisposable, IServiceType, IGameGui
|
|||
this.gameGuiService.UiHideToggled -= this.UiHideToggledForward;
|
||||
this.gameGuiService.HoveredItemChanged -= this.HoveredItemForward;
|
||||
this.gameGuiService.HoveredActionChanged -= this.HoveredActionForward;
|
||||
|
||||
this.UiHideToggled = null;
|
||||
this.HoveredItemChanged = null;
|
||||
this.HoveredActionChanged = null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -156,6 +156,8 @@ internal class PartyFinderGuiPluginScoped : IDisposable, IServiceType, IPartyFin
|
|||
public void Dispose()
|
||||
{
|
||||
this.partyFinderGuiService.ReceiveListing -= this.ReceiveListingForward;
|
||||
|
||||
this.ReceiveListing = null;
|
||||
}
|
||||
|
||||
private void ReceiveListingForward(PartyFinderListing listing, PartyFinderListingEventArgs args) => this.ReceiveListing?.Invoke(listing, args);
|
||||
|
|
|
|||
|
|
@ -417,6 +417,10 @@ internal class ToastGuiPluginScoped : IDisposable, IServiceType, IToastGui
|
|||
this.toastGuiService.Toast -= this.ToastForward;
|
||||
this.toastGuiService.QuestToast -= this.QuestToastForward;
|
||||
this.toastGuiService.ErrorToast -= this.ErrorToastForward;
|
||||
|
||||
this.Toast = null;
|
||||
this.QuestToast = null;
|
||||
this.ErrorToast = null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -169,6 +169,8 @@ internal class GameNetworkPluginScoped : IDisposable, IServiceType, IGameNetwork
|
|||
public void Dispose()
|
||||
{
|
||||
this.gameNetworkService.NetworkMessage -= this.NetworkMessageForward;
|
||||
|
||||
this.NetworkMessage = null;
|
||||
}
|
||||
|
||||
private void NetworkMessageForward(nint dataPtr, ushort opCode, uint sourceActorId, uint targetActorId, NetworkMessageDirection direction)
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ public static class Util
|
|||
/// </summary>
|
||||
/// <param name="path">The path of the file to write to.</param>
|
||||
/// <param name="text">The text to write.</param>
|
||||
internal static void WriteAllTextSafe(string path, string text)
|
||||
public static void WriteAllTextSafe(string path, string text)
|
||||
{
|
||||
var tmpPath = path + ".tmp";
|
||||
if (File.Exists(tmpPath))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue