[FIXED] Memory leak accessing image.path of a new object.

See this code below - memory leak happens with rects, images and sprites.

Just accessing the image.path property is enough to make it kick in.

Comment out lines 19 and 20 to see how the memory usage remains stable, despite creating and deleting 100 rects per frame.

[lua]--------------------------------------------------------------

– SET UP EVERYTHING -----------------------------------------

– Memory text display

local memoryText = display.newText(‘00 00.00 000’,10,0, ‘Helvetica’, 20)

memoryText.x     = 100

memoryText.y     = 50


– ENTERFRAME ------------------------------------------------

local function enterFrame( event )

    – Create a ton of images (shows up the leak a lot easier!)

    for i = 1, 100 do

        local rect = display.newRect( 0, 0, 100, 100 )

    

        – Get rect path - comment out these two lines and see how the memory remains stable

        local rectPath = rect.path

        rectPath       = nil

        

        rect:removeSelf()

    end

    

    – Clean memory every single frame, twice over!

    collectgarbage( “collect” )

    timer.performWithDelay( 1, function() collectgarbage( “collect” ) ; end )

    

    – Update the memory display - watch this count up slowly

    memoryText.text = tostring( math.floor( collectgarbage( “count” ) ) ) 

    memoryText:toFront()

    

end


– LET’S GO! -------------------------------------------------

Runtime:addEventListener(‘enterFrame’, enterFrame )[/lua]

This is still in the latest daily build.

Could I at least get some acknowledgement that you guys can see the bug with the code posted above?

I’m devoting quite a lot of my time to putting some parts of G2 through its paces, and it is a bit disheartening to have things just completely ignored.

Sorry, we’ve been busy trying to wrap up P1’s for beta.

I’ve added it to be verified and investigated.

Ok cheers. For me it is a P1 as it causes crashes very quickly indeed.

I should point out the leak happens on the ipad and in the mac simulator.

The issue is now resolved and will be available in the upcoming daily build. Thanks again!

Awesome, cheers!

This is still in the latest daily build.

Could I at least get some acknowledgement that you guys can see the bug with the code posted above?

I’m devoting quite a lot of my time to putting some parts of G2 through its paces, and it is a bit disheartening to have things just completely ignored.

Sorry, we’ve been busy trying to wrap up P1’s for beta.

I’ve added it to be verified and investigated.

Ok cheers. For me it is a P1 as it causes crashes very quickly indeed.

I should point out the leak happens on the ipad and in the mac simulator.

The issue is now resolved and will be available in the upcoming daily build. Thanks again!

Awesome, cheers!