Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Circular reference
Message
From
05/02/2002 10:04:02
 
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00615370
Message ID:
00615472
Views:
20
Yes. Destroy is just depended on the object reference counter, not on the Release. You can call that method by another way, not Release, and it will still work (for example, call it "CleanUp"). The functionality is in internals - in the way how VFP tracks all references to objects to know when object should be released - when this object is no longer used by anything (References Count = 0).

>Your solution works fine!
>
>I try this and seems work
>
>Release inside the object trigger the destroy events, outside don't trigger?
>
>
>*---------------------------------------------------
>acti screen
>clear
>
>public goBusiness
>goBusiness=createobject('Business')
>goBusiness.Release()
>
>*-- USO DE LA CLASE SESSION
>define class Business as Custom
>
> protected oData
>
> procedure Release
>
> release this
>
> endproc
>
> procedure init
>
> ? 'Business.init'
> this.oData=createobject('Data',this)
>
> endproc
>
> procedure destroy
>
> ? 'Business.destroy'
>
> endproc
>
>enddefine
>
>define class Data as Session
>
> protected oBusiness
>
> procedure Init
>
> lParameters toBusiness
>
> ? 'Data.init'
> this.oBusiness=toBusiness
>
> endproc
>
> procedure destroy
>
> ? 'Data.destroy'
>
> endproc
>
>enddefine
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform