Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining Object References and Closing
Message
From
03/10/2001 15:48:25
 
 
To
03/10/2001 14:46:01
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00563520
Message ID:
00563835
Views:
13
>>>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

I think he is referring to the Release() method. For example on a form, if you have a close button you call Thisform.Release(). For a custom object you would include this method and instead of doing something like release myObj you would call myObj.Release(), setting the release flag for the Clean_up method called from the Destroy().
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform