WeakRef
From Real Software Documentation
Allows you to retain a reference to an object without requiring it to stay alive.
| Properties | |||
|
| Constructors | |
|
Notes
WeakRef is useful when you want to find out when an object (such as a database or TCP/IP connection) is still in use somewhere in the application. The reference returned by WeakRef goes to Nil as soon as there are no longer any references to the object. This is the signal that you can do any necessary cleanup work.
When the object is destroyed, the WeakRef's value will change to Nil after all ordinary references have been released and the object has been destroyed. Otherwise, the Value property returns the target object.
Examples
This example creates a weak reference to a REALSQLdatabase object. The property db as REALSQLdatabase is a property of the App class.
