Pranav,
I think you are right. I always clear out any object reference, even
if it is in a local variable. But I just ran a test using the
watcher. It looks like if you keep an object reference in a local
variable (whether it is inside an object or not), then when the scope
of the local variable ends (exit from the current handler), the
reference count goes down.
My apologies.
Irv
(Agust�n: Please send Pranav the t-shirt AND the cup!)
At 1:26 PM +0530 10/19/01, [EMAIL PROTECTED] wrote:
>Me'z got a _little_ doubt...
>
>Taking Irv's example, suppose I use a local variable instead of a property
>variable like this:
>
>-- Parent script
>on new me
>vRef = me -- Local variable
>return me
>end new me
>
>-- Msg window
>gObj = new(script "Parent")
>gObj = void
>
>In a situation like this would I still have vRef floating around as an
>orphan object in memory?
>
>Pranav Negandhi
>New Media Applications.
>Learnet India Limited, Mumbai.
>Phone: 91-22-859 8042 Ext: 410
>
>
>
><snip>
>> Case 2) Lets say you have a parent script like this, in the new
>> handler, you to store a copy of "me" into a property variable "pMe" -
>> as Kerry originally suggested earler before recanting :)
>>
>> -- someParentScript:
>>
>> property pMe
>>
>> on new me
>> pMe = me -- this sets the "ref count" to 1
>> return me
>> end
>>
>> And you create it with the following line
>>
>> someObjectReference = new(script "someParentScript") -- this sets
>> the "ref count" to 2
>>
>>
>> Then later, as you say, you destroy the object like this:
>>
>> someObjectReference = VOID -- in an attempt to the object
>>
>> But ... the object isn't destroyed because pMe still holds a
>> reference to the object. The ref count just goes from 2 down to 1.
>>
>> Now, unfortunately, you have an "orphaned" object. There is this
>> object lying around taking up memory, but you cannot get to it
>> because there while there still is an object reference - there is no
> > way you can get to it.<snip>
>
--
Lingo / Director / Shockwave development for all occasions.
(Home-made Lingo cooked up fresh every day just for you.)
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]