WeakRef.Constructor(obj as Object)

From Xojo Documentation

Constructor
WeakRef.Constructor(obj As Object)

Creates a WeakRef instance.

Notes

The target object that you want to retain a reference to after it has been destroyed.

Sample

This example creates a weak reference to a SQLiteDatabase object. The property "db As SQLiteDatabase" is a property on the App object.

Dim dbRef As WeakRef

// Create Database Object
DB = New SQLiteDatabase
dbRef = New WeakRef(DB)
// Set Database File
DB.DatabaseFile = GetFolderItem("MyDatabase.sqlite")