function Someclass:destroy()for i, val in self doif val.removeFromParent and val:getParent()then
val:removeFromParent()end
self[i]=nilendif self.removeFromParent and self:getParent()then
self:removeFromParent()end
self =nilend
Well it all depends on implementation, if it's a Gideros built in class (as Sprite) than yes it should be enough But if it's a custom class inherited from something or plain class, it all depends on what you do inside it
@thanhquan1512, you can also dump the memory usage after garbage collection to check for the usage of memory and leaks (if any)
@Atilim, is there a way to get the Texture memory and other memory allocated by the applications? That can allow to have some sort of a debug log overlay that displays how the memory is being allocated or deallocated.
@Arthurs, that might take care of the Texture Memory, what about the other memory used by the application, the systemMemory, that is what I am talking about too.
Comments
Compare with Gideros, we just call sprite:removeFromParent() or parent:removeChild(sprite). Is this ok?
Don't know why my game getting slower after a short time of continue playing
Ultimate Games on Appstore
Ultimate Games on Google Play
But if it's a custom class inherited from something or plain class, it all depends on what you do inside it
@Atilim, is there a way to get the Texture memory and other memory allocated by the applications? That can allow to have some sort of a debug log overlay that displays how the memory is being allocated or deallocated.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps