I’ve been using this function for 5+ years.
local coronaMetaTable = getmetatable(display.getCurrentStage()) local isDisplayObject = function(aDisplayObject) return (type(aDisplayObject) == "table" and getmetatable(aDisplayObject) == coronaMetaTable) end local cleanGroups cleanGroups = function ( objectOrGroup, anim ) if not anim then if(not isDisplayObject(objectOrGroup)) then return end if objectOrGroup.numChildren then while objectOrGroup.numChildren \> 0 do cleanGroups ( objectOrGroup[objectOrGroup.numChildren]) end end if objectOrGroup.audioFile then objectOrGroup.audioStop() end objectOrGroup:removeSelf() objectOrGroup = nil return else anim.onComplete = function () cleanGroups(objectOrGroup);end transition.to(objectOrGroup,anim) end end
For the last 2 weeks of daily builds it crashes the simulator and the app on device.
object:removeSelf()
Something has definitely changed with this function, it’s buggy and it crashes any instance WITHOUT an assertion, warning, anything.
Please fix.
Thank you,
Aidan