Skip to content

Commit d9a4c8e

Browse files
committed
Skip handle PendingCalls when not in main thread
1 parent f836ffa commit d9a4c8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/runtime/finalizer.cs

+4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ internal static void Shutdown()
9292
return;
9393
}
9494
Instance.DisposeAll();
95+
if (Thread.CurrentThread.ManagedThreadId != Runtime.MainManagedThreadId)
96+
{
97+
return;
98+
}
9599
Instance.CallPendingFinalizers();
96100
}
97101

0 commit comments

Comments
 (0)