This documentation is archived and is not being maintained.

GCHandle.Free Method

Releases a GCHandle.

[Visual Basic]
Public Sub Free()
[C#]
public void Free();
[C++]
public: void Free();
[JScript]
public function Free();

Exceptions

Exception Type Condition
InvalidOperationException The handle was freed or never initialized.

Remarks

The caller must ensure that for a given handle, Free is called only once.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

.NET Framework Security: 

See Also

GCHandle Structure | GCHandle Members | System.Runtime.InteropServices Namespace

Show: