This method can be used to determine if the handle is still allocated. This method is particularly useful when using weak handles GCHandleType- Weak) since it provides a way of determining if the GC handle is still available. When the GC attempts to collect the object, the latter could still be resurrected in the finalizer. In this case, the handle will not be allocated (this is lost when the GC attempts to collect the object) although the Target object is valid.
[Visual Basic] Public ReadOnly Property IsAllocated As Boolean [C#] public bool IsAllocated {get;} [C++] public: __property bool get_IsAllocated(); [JScript] public function get IsAllocated() : Boolean;
Returns true if the handle is allocated, else false.
GCHandle Structure | GCHandle Members | System.Runtime.InteropServices Namespace