Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cleaning up leftover objects
Message
De
20/11/2010 10:49:25
 
 
À
20/11/2010 10:30:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01489909
Message ID:
01489912
Vues:
64
Thanks! It looks like your code actually uses all three of the ways I had thought of .... so, I guess I've got some digging to do.



>>A question about cleaning up leftover objects:
>>
>>I have a number of objects which themselves contain objects (in properties). What is the best way for these objects to clean up after themselves?
>>
    This.oObject.Release()
>>    Release This.oObject
>>    This.oObject = .Null.
>>Are these all equivalent?
>>
>>Thanks
>
>
>TRY
>     IF TYPE("myObject") = "O" and ! ISNULL(myObject)
>           myObject.Release()
>     ENDIF
>CATCH TO loError
>     *--do logging
>ENDTRY
>TRY
>      myObject = null 
>      RELEASE myObject
>CATCH TO loError
>ENDTRY
>
>
>But also read these:
>
>http://www.west-wind.com/wconnect/weblog/ShowEntry.blog?id=692
>http://www.foxpert.com/docs/safeclasses.en.htm
Jim Nelson
Newbury Park, CA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform