Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cleaning up object references
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00167010
Message ID:
00167017
Vues:
22
Paul,

One approach would be to create a cleanup method in your main object.

This would be called by your exit routine, which in turn is typically called by ON SHUTDOWN -- that way no matter has the app is closed, the cleanup method gets invoked.

The cleanup method would release or destroy the two subordinate objects (make certain the the destroy event of the subordinate object all reference to the main object are destroyed by setting them to .NULL.), then restore the VFP environment, then destroy the main object, then quit.

Generally containers destroy all contained objects when the container is destroyed -- i.e. all objects on a form are destroyed when the form is destroyed. But non-container objects (which is sounds like you are using) require more deliberate coding.

good luck,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform