Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine if class is light or heavy
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00924940
Message ID:
00925646
Vues:
20
James,

Yes, when objects have been composited at designtime, or via AddObject() at runtime, the destruction of the contained objects happens automatically. There is also the benefit in that "generic" methods can be written to use this.parent to go outwards and use the Objects[] collection to go inwards. This is very handy to broadcast method calls or property sets.

If you use object references with Create/NewObject() calls then you should explicitly null those references out during the destruct sequence.

>Am I correct in thinking that a major advantage of the containership method is that, when the parent container is destroyed, all of the contained objects will be destroyed and your garbage collection is taken care of ? This is as opposed to having object references created with CREATEOBJECT/NEWOBJECT ?
>
>I currently use the later method and have to make sure that I destroy referenced objects so that (a) they are destroyed and (b) VFP gets the counter down to 0 for the class and releases the memory associated with it.
>
>I'm thinking that I should have been using AddObject() all along ...
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform