VCursor life

Gunnar Swan GunnarSwan at PracticeToPass.com
Sat Mar 15 18:17:11 CST 2003


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.

But my question is ....

Should not the cursor 'die' at the end of the handler ?
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 ?

What is the rule of the life of the cursor outside of the local declaration in the handler ?

Gunnar.






More information about the Valentina mailing list