ThreadPoolBoundHandle.FreeNativeOverlapped(NativeOverlapped*) 方法

定义

重要

此 API 不符合 CLS。

释放与 AllocateNativeOverlapped 方法分配的 NativeOverlapped 结构关联的内存。

C#
[System.CLSCompliant(false)]
public void FreeNativeOverlapped(System.Threading.NativeOverlapped* overlapped);
C#
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public void FreeNativeOverlapped(System.Threading.NativeOverlapped* overlapped);

参数

overlapped
NativeOverlapped*

一个非托管指针,指向要释放的 NativeOverlapped 结构。

属性

例外

overlappednull

在释放 ThreadPoolBoundHandle 对象后调用此方法。

注解

注意

对于使用 方法分配的每个NativeOverlapped非托管指针,必须FreeNativeOverlapped恰好调用方法一AllocateNativeOverlapped次。 如果不调用 FreeNativeOverlapped 方法,则会泄漏内存。 如果在同一NativeOverlapped非托管指针上多次调用 FreeNativeOverlapped 方法,内存将损坏。

适用于

产品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0