Hi,
we are adding all objects on screen to a array and calling a cleanup function to remove those objects. we also are using director 1.3, but strangely it seems that the object is still lurking (or we are not removing it properly)
here is the code snippet
[lua]local addScreenObjs
local removeScreenObjs
screenObjs = {}
addScreenObjs = function(obj)
screenObjs[#screenObjs+1] = obj
end
removeScreenObjs=function()
local i
for i = #screenObjs,1,-1 do
local_group:remove(screenObjs[i])
screenObjs[i] = nil
end
– create screen
– some other code
– …
local cleanup()
removeScreenObjs()
– print (somebutton.x)
end
end[/lua]
The point is after caling removeObjs, if we print the position of a button for eg which was supposedly removed, it still appears to be lurking around. we even tried forced garbage collection which did not help either.
what is the right way to remove displayobjects? is it different if we dont or use director?
thanks
[import]uid: 55009 topic_id: 12849 reply_id: 312849[/import]
[import]uid: 12482 topic_id: 12849 reply_id: 47145[/import]