Browse Source

Don't be noisy about just-in-case Dispose call on disposed object on finalizer thread

pull/2117/head
Nikita Tsukanov 8 years ago
parent
commit
d1e3047410
  1. 8
      src/Shared/PlatformSupport/StandardRuntimePlatform.cs

8
src/Shared/PlatformSupport/StandardRuntimePlatform.cs

@ -89,9 +89,11 @@ namespace Avalonia.Shared.PlatformSupport
#if DEBUG
if (Thread.CurrentThread.ManagedThreadId == GCThread?.ManagedThreadId)
{
Console.Error.WriteLine("Native blob disposal from finalizer thread\nBacktrace: "
+ Environment.StackTrace
+ "\n\nBlob created by " + _backtrace);
lock(_lock)
if (!IsDisposed)
Console.Error.WriteLine("Native blob disposal from finalizer thread\nBacktrace: "
+ Environment.StackTrace
+ "\n\nBlob created by " + _backtrace);
}
#endif
DoDispose();

Loading…
Cancel
Save