Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing objects?
Message
De
08/10/1997 19:59:18
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00053676
Message ID:
00053798
Vues:
34
>>>What's the proper way to release an object? For example, if I :
>>>x=Createobject('myobject') where myobject is a class based on the
>>>cutom class (and thus, has no Release method built in)? x.Destroy()
>>>doesn't work since destroy is an even. I hate using Release x.
>>
>>why? if you're going to create in code, it makes sense (and easy reading) to release in code.
>
>I am releasing in code. I would like to have a method in my class that
>releases itself, however. So I could have the following easily readable code:
>
>o = Createobject('myobject')
>o.Show()
>o.This()
>o.That()
>o.TheOther()
>o.Release()
>
>
>Instead, I'm forced to change the last line to:
>
>"Release o", which I think is ugly.

Why don't you put the "RELEASE o" in a user defined Release method?

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform