Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining Object References and Closing
Message
De
03/10/2001 14:46:01
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
03/10/2001 11:09:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00563520
Message ID:
00563790
Vues:
34
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform