Xojo.Core.WeakRef.Create

From Xojo Documentation

Shared Method

Creates a WeakRef that wraps the given object.

Exceptions

Sample Code

Create a WeakRef of an object instance:

Dim ref As Xojo.Core.WeakRef
ref = WeakRef.Create(myObject)

Later you can test if there are references remaining by using the Value property:

If ref.Value <> Nil Then
myObject2 = MyObject(ref.Value)
Else
// no more references
End If