Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need to nuke objects in Destroy?
Message
 
À
26/08/2009 11:59:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01405727
Message ID:
01420863
Vues:
64
Hi Matt,

>So, how can you scan the over the properties like above, without having to know the property names?

Three problems. I'm German, we always talk about the problems first ;-)

1. Destroy is too late. If you have a dangling reference, Destroy doesn't fire.

2. Just setting these properties to NULL works, if they object only holds a reference in case it needs to access those. However, in many cases there's some of protocol established: Objects register with a mediator, some objects subscribe to events, etc. Whenever one object established a mutual relationship with another object you need to break this relationship before clearing the property.

3. To avoid dangling references, it's not enough to clear reference in your object. You also have to clear all references that point _TO_ your object. As object references are one ways, there's no really easy and generic way to find all these references automatically.
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform