|
script erase itself from memory
>Q: how do I have a script erase itself from memory?
Basically, I do it like this,
(only I usually collect those suicide calls in a list of trash
that is emptied regularily triggered by some other event)
-- movie script
on makeObject scriptObj
global gLpObjects
if voidP(gLpObjects) then set gLpObjects = [:]
set dObj = new (script scriptObj)
set dObjId = getId(dObj)
addprop gLpObjects,dObjId,dObj
end
on KillObject dbjId
global gLpObjects
set da = findPos(gLpObj,dObjId)
if da then deleteAt gLpObjects,da
end
--Parent script
property myId
on new me
set myId = #SomethingSpecial
return me
end me
on rubOut me
killObject myId
end
Best regards
Daniel Plaenitz
.......................
dp@lingo.de
<http://www.lingo.de>
|