Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining Object References and Closing
Message
 
 
To
03/10/2001 08:40:51
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00563520
Message ID:
00563553
Views:
25
This message has been marked as a message which has helped to the initial question of the thread.
>I'm trying to tighten-up a couple applications and want to know if there is a way to cycle through all the existing object references so they can be set to NULL before shutdown? Thanks!
>
>Regards, Renoir

You might try looking at the AINSTANCES() function. It will give you an array filled with variable names that have references to the specified object. You could then loop through the array and set eacj variable to .NULL..

Another approach is to add a Release method (if one doesn't already exist) to your objects with the following code:

release THIS

The usual course is to set variables to .NULL.. When the last reference to the object is set to .NULL., the object's Destroy method fires. Calling Release will release the object firing its Destroy method immediately. All references to the object will automatically be set to .NULL. because the variable will no longer exist.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform