basically every time you turn this off and on, the craft scene engine has to regenerate the mipmaps-
if not self.shortenedRenderDistance then
craft.texture(self.img):generateMipmaps() --remove fog effect
self.img.premultipled=true
end
this means all these mipmaps steal memory and are never cleaned up, i’m not sure if there is a direct way to destroy them but if you add the line collectgarbage() at the end of the draw function it will fix the crash
personally i use collectgarbage() at the end of my draw function in all projects i’ve worked on as i don’t see it effecting performance at all and it’s only beneficial to have cleanup every frame
@skar@UberGoober - tried adding the collectgarbage() in the draw function then flipped the visible/invisible parameter several times then the second parameter Codea crashed.
I don’t think it’s something to do with the setting up parameters part of the class. I think they may need to be independent of the class and call the class with the entity id.
@dave1707 please let me know if you ever find a solution.
I’d try to help if I could, but I can’t see what I could really do, because it’s not happening for me anymore. If there’s a way I can help I’ll be happy to.
All, can you post what your iOS and kit id’s are. I get exactly the same as @dave1707. Although I have played around with it a bit, but I don’t think the changes I made are responsible.