[V4MD] VCursor life
Gunnar Swan
GunnarSwan at PracticeToPass.com
Sun Mar 16 09:56:30 CST 2003
Declared locally, not a global, not a property. The code in question is a movie handler.
The variable containing the cursor instance should of gone out of scope.
If the object instance is still active, so is the property, I'm aware. But it's a movie handler.
This is not a big one, because I "ALMOST" always do a cursor = VOID.
But this one got by me, and I found it had a value from a previous movie handler.
3/16/03 8:04:18 AM, "Mathew Ray" <mathew at iqtv.com> wrote:
>Gunnar,
>
>Is the variable in question a property of a behavior, with a property pMyVar
>declaration somewhere? Or is it just a locally declared variable (with no
>property declaration)? Even if you leave a handler with a property variable,
>it is scoped to the sprite instance that the behavior is attached to, so it
>is possible that the property variable still exists if the playhead has not
>left the bounds of the sprite. Judging from your code, this seems to be the
>case... I guess there is a "property ResponseCursor" line somewhere else on
>your script so that those handlers can pass a reference to the cursor around
>to each other. By chance, is this a Movie, Behavior, or frame script?
>
>~Mathew
>
>> -----Original Message-----
>> From: valentina-bounces+mathew=iqtv.com at lists.macserve.net
>> [mailto:valentina-bounces+mathew=iqtv.com at lists.macserve.net]On Behalf
>> Of Ruslan Zasukhin
>> Sent: Sunday, March 16, 2003 3:03 AM
>> To: valentina at lists.macserve.net
>> Subject: Re: [V4MD] VCursor life
>>
>>
>> on 3/16/03 4:17 AM, Gunnar Swan at GunnarSwan at practicetopass.com wrote:
>>
>> >
>> > Director ...
>> >
>> > ---------- start snippet
>> > on SomeHandler me
>> > set ResponseCursor = new ("VCursor", UsageReference, tmpSELECT)
>> > end
>> > ---------------- end snippet
>> >
>> > The handler above declares a variable with an instance of the vCursor.
>> > Normally, I will kill the cursor with
>> >
>> > --------------start snippet
>> > on SomeHandler me
>> > set ResponseCursor = new ("VCursor", UsageReference, tmpSELECT)
>> > set ResponseCursor = VOID -- << Kill cursor
>> > end
>> > ----------------end snippet
>> >
>> > Well ... I didn't do this on one occasion, the cursor was
>> 'alive' with the
>> > name 'ResponseCursor'
>> >
>> > In the debugger, I went into another handler, and just happen to have a
>> > variable named 'ResponseCursor'/
>> > I was getting an instance of a cursor from another handler BEFORE the
>> > declaration in the current handler.
>> >
>> > This is why it is so important to kill a cursor with Cursor =
>> VOID. And I
>> > normally do.
>>
>> Hmm, I was sure that in Lingo if you NOT declare variable to be
>> global then
>> it must be local and must be destroyed by Director on exit of handler...
>> No???
>>
>>
>> > But my question is ....
>> >
>> > Should not the cursor 'die' at the end of the handler ?
>>
>> I wonder also on this!!!
>> Of course here works garbage collector of Director.
>> In fact they do not promise kill object as soon as it is out of scope.
>>
>> But the main problem which I see here is:
>> why other handler do not see EMPTY/ZERO/VOID value for its own local
>> variable ???
>>
>> > Is it possible that Director is not garbage collecting and for
>> some reason the
>> > cursor is alive outside of the handler in which it is declared ?
>>
>> Gunnar, may be it is really declared as global ?
>>
>> > What is the rule of the life of the cursor outside of the local
>> declaration in
>> > the handler ?
>>
>> This is not MY rules. Here work Director.
>> I cannot change anything inside of Director.
>>
>> --
>> Best regards,
>> Ruslan Zasukhin [ I feel the need...the need for speed ]
>> -------------------------------------------------------------
>> e-mail: ruslan at paradigmasoft.com
>> web: http://www.paradigmasoft.com
>>
>> To subscribe to the Valentina mail list go to:
>> http://listserv.macserve.net/mailman/listinfo/valentina
>> -------------------------------------------------------------
>>
>> _______________________________________________
>> Valentina mailing list
>> Valentina at lists.macserve.net
>> http://lists.macserve.net/mailman/listinfo/valentina
>
>
>_______________________________________________
>Valentina mailing list
>Valentina at lists.macserve.net
>http://lists.macserve.net/mailman/listinfo/valentina
>
Best Regards,
Gunnar Swan
http://www.PracticeToPass.Com
Software Built For Statutory Courses
More information about the Valentina
mailing list