>I have an object based on Custom class. I have added a .Release method, which contains Release This (after checking for dangling references and so on). So basically the method releases the object it belongs.
>
>As far as I can tell, it works good, but however, I'd rather ask: I am asking for trouble with this approach?
>
>Thank you.
VFP it annuls all the dangling reference for you:
dangling1=CREATEOBJECT("ciccia")
dangling2=dangling1
dangling2.Release
? dangling1
? dangling2
DEFINE CLASS ciccia as custom
PROCEDURE Release
RELEASE this
PROCEDURE destroy
? "destroy"
ENDPROC
this is worth even if the object is a member of a form.