Class PixelMemoryLeakEventArgs
- Namespace
- Egami
- Assembly
- Egami.dll
Describes a pixel memory block that was collected without being disposed.
public sealed class PixelMemoryLeakEventArgs : EventArgs
- Inheritance
-
PixelMemoryLeakEventArgs
- Inherited Members
Examples
// In tests or debug builds: report a raster that was never disposed, and where it was allocated.
PooledPixelMemorySource memory = new();
memory.Usage.TrackLeaks = true;
memory.Usage.CaptureStackTraces = true;
memory.Usage.LeakDetected += (sender, e) =>
Console.Error.WriteLine($"Leaked {e.Bytes:N0} bytes, allocated at:\n{e.StackTrace}");
Properties
Bytes
Gets the size of the block in bytes.
public long Bytes { get; }
Property Value
StackTrace
Gets the stack trace of the allocation, or null if stack traces were not captured.
public string? StackTrace { get; }