提交 73aad3f2 编写于 作者: S Sam Harwell

Avoid releasing memory mapped file handles during shutdown

Fixes #19493
上级 4566936c
......@@ -48,8 +48,14 @@ public CopiedMemoryMappedViewHandle(SafeMemoryMappedViewHandle viewHandle)
public byte* Pointer => (byte*)handle;
protected override bool ReleaseHandle()
{
// The operating system will release these handles when the process terminates, so do not spend time
// releasing them manually in that case. Doing so causes unnecessary delays during application shutdown.
if (!Environment.HasShutdownStarted)
{
_viewHandle.ReleasePointer();
}
return true;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册