Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reference Counting
Message
De
21/09/1999 11:28:49
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
21/09/1999 11:21:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00267018
Message ID:
00267138
Vues:
30
Looking back at the original post I realize I have misunderstood the exact problem. I was thinking of the ControlCount reference at the 'parent', not the internal reference counter of the 'child' 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.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform