Information générale
Catégorie:
Programmation Orientée Object
Are you sure about this Mark? If I try this:
oFormA = NewObject("MyForm", "MyFormClass")
oFormA.Show() && Form visible
oFormB = oFormA
oFormA = NULL && Form still visible
oFormB = NULL && Form is released
So, IMHO, VFP must increment a reference counter when an object reference is assigned to another variable.
>Foxpro keeps a counter to 'contained' objects (controlCount). This gets incremented when child objects are added at run-time through the AddObject method or the ADD OBJECT statement in a class definition.
>
>A 'weak' link (if you define this as a link that doesn't update the counter) can be simulated just be assigning a reference to a child object to a custom property at run-time.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement