Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Destroy object reference
Message
De
08/04/2002 11:17:45
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
08/04/2002 11:06:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00642179
Message ID:
00642222
Vues:
14
The advise doesn't work for me. I feel more comfortable with thinking about cleaning up in conjunction with destroy.

See http://fox.wikis.com/wc.dll?Wiki~ManualGarbageCollection and you'll notice no calls are made during unload. Although were one to desire to clean up during unload, following Steves advice would be good too.


>>Well, that's why I hedged my bet and left destroy as a second choice. :) Although I can't think of a specific circumstance where waiting until unload() would be a problem.
>>
>>The rule of thumb I follow is this. I try to clean up objects and settings at the same level as I created/changed them. If I create the object at load(), I clean up at unload(). If I do something at init(), I do the cleanup for it at destroy().
>
>That looks like a good rule of thumb. Besides, your answer helped me clarify the relationship between the methods.
>
>In this case, I create a reference to an object on the same screen. At Form.Load(), the objects don't exist yet, so the logical place to create the object reference is Form.Init(). That would leave the destruction to Form.Destroy(), according to your rule-of-thumb.
>
>Hilmar.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform