fix: tighten resource-leak and null-deref hot spots
Three pre-existing upstream defects flagged by CodeRabbit, fixed in the v1.0.0 standalone cut where we own the codebase: - Ipc/ExtraChat.cs Dispose now unsubscribes all three IPC subscriptions (OverrideChannelGate, ChannelCommandColoursGate, ChannelNamesGate) instead of only the first; previously the latter two leaked their subscriptions on every plugin reload - GameFunctions/Types/TellTarget.cs FromTarget guards against a zero IPlayerCharacter.Address before dereferencing the unsafe Character* cast; previously a missing/destroyed target object would crash the game on /tell construction - GameFunctions/GameFunctions.cs ResolveTextCommandPlaceholderDetour null-checks the Hook reference before calling .Original instead of using the null-forgiving operator; defensive guard for teardown races
This commit is contained in:
@@ -49,6 +49,8 @@ public sealed class ExtraChat : IDisposable
|
||||
public void Dispose()
|
||||
{
|
||||
OverrideChannelGate.Unsubscribe(OnOverrideChannel);
|
||||
ChannelCommandColoursGate.Unsubscribe(OnChannelCommandColours);
|
||||
ChannelNamesGate.Unsubscribe(OnChannelNames);
|
||||
}
|
||||
|
||||
private void OnOverrideChannel(OverrideInfo info)
|
||||
|
||||
Reference in New Issue
Block a user