cannot dispose newImageSheet object properly (new sprite API)

In short :slight_smile:

How to dispose properly this object

local imageSheet = graphics.newImageSheet()

it has no functions or variables assigned to it, just .userdata

imageSheet:dispose()
nor
imageSheet:removeSelf()
nor
imageSheet = nil

does not free the memory, even when no sprites from this sheet were created.

Tom [import]uid: 111283 topic_id: 25570 reply_id: 325570[/import]

Hi,
the blog post says:

boomBloesemAnim7:removeSelf( )
boomBloesemAnim7=nil
boomBloesemImageSheet=nil

Might be the garbage collecting that is garbage.
[import]uid: 100901 topic_id: 25570 reply_id: 103359[/import]

local boomBloesemImageSheet = graphics.newImageSheet("…")
boomBloesemImageSheet = nil

does not free memory or do i miss something ?

imageSheet object does not have any functions nor parameters to change. It can just be nulled.

Any ideas where is problem ?
[import]uid: 111283 topic_id: 25570 reply_id: 103392[/import]

ive been trying to test it and have no positive results.
It seems that GC is NOT collecting imageSheet object.

Tom [import]uid: 111283 topic_id: 25570 reply_id: 103833[/import]

Might be that GC thinks it is not needed yet and that it will dispose after a while if other things take up more memory.
I always thought reference counting was a pain in Obj C, now I actually prefer it to this thing Lua/corona does. [import]uid: 100901 topic_id: 25570 reply_id: 103838[/import]

Thanks,

Anybody else has such problem ? Ive checked on device and memory is not cleared even when fallow standard Lua memory rules

[import]uid: 111283 topic_id: 25570 reply_id: 105138[/import]

Solution to this one is to run GC with slight delay like 1-10 ms then it properly clean memory from sprite objects. [import]uid: 111283 topic_id: 25570 reply_id: 106312[/import]