Hi!
Destroy is not called at all for object before all references to it are removed. Sp, before Release you require to clean up the all references to object. Release free up the variable from memory, but object is still in the memory. Just after runnign program, issue CLEAR ALL and you will see how Destroy Events are running.
>Hi
>
>I'm testing some classes defined in prg, I have problems with a circular reference. Why isn't trigger the destroy event?
>
>Here is the code, copy in a prg and run!!!
>
>*------------------------------------------------------------------
>acti screen
>clear
>
>public goBusiness
>goBusiness=createobject('Business')
>release goBusiness
>
>*-- USO DE LA CLASE SESSION
>define class Business as Custom
>
>protected oData
>
>procedure init
>
>? 'Business.init'
>this.oData=createobject('Data',this)
>
>endproc
>
>procedure destroy
>
>? 'Business.destroy'
>this.oData=.null.
>
>endproc
>
>enddefine
>
>
>define class Data as Session
>
>protected oBusiness
>
>procedure Init
>
>lParameters toBusiness
>
>? 'Data.init'
>this.oBusiness=toBusiness
>
>endproc
>
>procedure destroy
>
>? 'Data.destroy'
>this.oBusiness=.null.
>
>endproc
>
>enddefine
>*-----------------------------------------------------------
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.