Browse Source

volatile read on totalUndisposedAllocationCount

Co-authored-by: Günther Foidl <gue@korporal.at>
pull/1969/head
Anton Firszov 4 years ago
committed by GitHub
parent
commit
fb3bd92580
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/ImageSharp/Diagnostics/MemoryDiagnostics.cs

2
src/ImageSharp/Diagnostics/MemoryDiagnostics.cs

@ -46,7 +46,7 @@ namespace SixLabors.ImageSharp.Diagnostics
/// </summary>
public static int TotalUndisposedAllocationCount => totalUndisposedAllocationCount;
internal static bool MemoryResourceLeakedSubscribed => undisposedMemoryResourceSubscriptionCounter > 0;
internal static bool MemoryResourceLeakedSubscribed => Volatile.Read(ref undisposedMemoryResourceSubscriptionCounter) > 0;
internal static void IncrementTotalUndisposedAllocationCount() =>
Interlocked.Increment(ref totalUndisposedAllocationCount);

Loading…
Cancel
Save