feat: Adds an Item/Mobile memory leak detector. Fixes minor leak in doors. (#2159)

### Summary

Adds the command [TrackLeaks to enable tracking item/mobiles that have been deleted but still have dangling references. Requires adding the _TRACK_LEAKS_ define constant during build.
This commit is contained in:
Kamron Batman 2025-04-15 19:14:45 -07:00 • committed by GitHub
parent 1e349f4369
commit 4aa272d429
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 256 additions and 9 deletions

View file

@ -492,7 +492,12 @@ public static class World
else
{
logger.Warning($"Attempted to call World.RemoveEntity with '{entity.GetType()}'. Must be a mobile or item.");
return;
}
#if TRACK_LEAKS
EntityFinalizationTracker.TrackEntity(entity);
#endif
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]