I found a memory leak in my project and tracked down to tableView:deleteAllRows() does not dispose of the display objects inside the rows it is deleting.
Is this expected behavior or a bug?
My test case (requires test.jpg):
[lua]
display.setStatusBar( display.HiddenStatusBar )
local widget = require( “widget” )
local tableView
local function printMemory()
print( “Tex:” … math.floor(system.getInfo( “textureMemoryUsed” )*0.000001*1000)*0.001 … “MB”)
end
local function onRowRender( event )
local testImage = display.newImageRect(event.row, “test.jpg”, 20,20)
testImage.x, testImage.y = 100, 20
end
tableView = widget.newTableView {
onRowRender = onRowRender,
}
tableView:insertRow{rowHeight = 80}
printMemory()
tableView:deleteAllRows()
printMemory()
[/lua]