Fumio Nonaka wrote
> Thank you again, Sean.
>
> OK. I will set the target (object) of a timeOut object to 'void'
> before disposing it with the 'forget'.
Hi,
I just noticed this thread - and thought I'd mention that I've experienced
the same bug - ie the timeout object hanging on to an object reference even
after the timeout has been forgotten (have a look at the archives for Feb
under the thread "object destruction"). In my case, the bug revealed itself
in a script like this (I noticed that the freebytes were getting eaten up
when this script was used frequently)
property myCallBackMsg -- symbol
property myCallBackObj -- object reference
property myTaskID -- symbol or integer
on new (me, callbackMethod, callBackObj, taskID, processRate)
myCallBackMsg = callbackMethod
myCallBackObj = callBackObj
myTaskID = taskID
timeout( me.string&&"thread").new(processRate, #mProcessThread, me)
end
on mProcessThread (me, aTimer)
-- doStuff
if SomeEndConditionReached() then
if objectP(myCallBackObj) then
call(myCallBackMsg, myCallBackObj, myTaskID)
end if
-- myCallBackObj = VOID <-- not needed if void timeout target
aTimer.target = VOID <--- needed to ensure that the forget() works
aTimer.forget()
end if
end
An object referenced by a timeout only seems to get destroyed properly when
the timeout's target is voided, but not when the timeout is just simply
forgotten.
Luke
[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!]