Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining Object References and Closing
Message
From
03/10/2001 14:46:01
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
03/10/2001 11:09:20
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00563520
Message ID:
00563790
Views:
33
>>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
>
>Also check out this MSDN article from FoxTalk: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfoxtk99/html/FT99J8.asp?frame=true
>HTH

Good stuff! The following is a portion of Doug Hennig's article, and following that a question regarding it:
The answer is surprisingly easy: Tell the object to release itself. I added a 
Release method to all of the classes in SFCTRLS.VCX, our base class library, 
that don’t natively have this method. Then, in the Release method, I put the 
following code (the last line isn’t required if the class has a native Release 
method):

if This.lRelease
  nodefault
  return .F.
endif This.lRelease
This.Cleanup()
release This
When should the Release method be called? From where? I was thinking in the Destroy, but later in the article Doug mentions that the Cleanup method is called from the Destroy, so then I wasn't sure.

Renoir
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform