IsAlive Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets an indication whether the object referenced by the current WeakReference object has been garbage collected.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public virtual bool IsAlive { get; }

Property Value

Type: System..::..Boolean
true if the object referenced by the current WeakReference object has not been garbage collected and is still accessible; otherwise, false.

Because an object could potentially be reclaimed for garbage collection immediately after the IsAlive property returns true, using this property is not recommended unless you are testing only for a false return value.

Show: