Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cleaning up leftover objects
Message
De
20/11/2010 10:30:37
 
 
À
20/11/2010 10:13:21
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:
01489910
Vues:
74
>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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform