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.

Var dbRef As WeakRef

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