Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Circular reference
Message
From
05/02/2002 08:40:50
 
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00615370
Message ID:
00615400
Views:
18
Rght. This is because you do not create additional reference to the object.

In VFP each object have internal property - Reference Count. As soon as you assign object to some variable or property, reference counter increased by 1. When variable released or property cleared, reference count is decreased by one. When reference count is zero, object is destroyed, so its Destroy method is called. When you release some object's variable (like in your sample with use of RELEASE command), object's reference count is descreased to 1, so it is not destroyed at all (its Destroy method is not called). When you remove the line "this.oBusiness=toBusiness", you do not create extra reference to the Business object, and as a result object is destroyed out from memory.

>Hi
>
>If you remove the line
>
> this.oBusiness=toBusiness
>
>from data.init, the destroy is trigger when release goBusiness, without a clear all
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