Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory Leak / Session Object
Message
 
 
To
05/11/2003 22:16:34
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00846763
Message ID:
00847085
Views:
24
Bob,
Datasessions are not objects. They are VFP internal structures that can be used to put boundries around data.

When an object (e.g. session, form, etc.) that has an external datasession mechanism is created, VFP creates a new datasession and assigns the new handle to the DatasessionID property. From this, you can switch to the datasession associated with it.

I believe all objects have a datasession mechanism. Some expose this externally. If an object didn't, then I don't think it could switch datasession context when executing code within itself. In this case, the scatter name object has an internal reference to the datasession that was explicitly created by the session object.

When you release an object with an external mechanism, VFP determines if all references to the associated structure have been released. In this case, the scatter name object still has an internal reference to the datasession structure and VFP does not release it.

Of course, this is all conjecture on my part.

Regards.

>>> When you issue a SCATTER NAME, you create a new object.
>I'm fully aware of this.
>
>>>Why should releasing the session object, which has NOTHING to do with the scatter name object, release the new object?
>
>I'm not saying that releasing a session object should free any memory allocated for an object reference that isn't bound to a cursor or data session. It is pretty obvious from my testing that a scatter name isn't scoped to a data session BUT it is bound to it, otherwise when you release a session object where a scatter name was issued within that session objects data session, the data session should go away. Atleast this makes sense to me, but this doesn't happen. If a scatter name is bound (in some way) to the data in a Session object then the session object has A LOT to do with the scatter name command.
>
>
>>>Objects live in the datasession they are created which is probably why the datasession isn't closed until you release the scattered object. However, datasessions are not bound to objects. If something is still attached to the datasession, it won't go away.
>
>I'm not speaking about objects that are members of a class or local references of a method of a class. I'm saying an object reference created by a scatter name when you are in the data session of that session object. The session object and the reference created by the scatter name have the same scope and the session object is released and scatter reference isn't release. In this scenario the object do not live in the data session they are created in. Here is another example that is easier to read
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform