defold icon indicating copy to clipboard operation
defold copied to clipboard

go.set memory leak

Open hippocoder opened this issue 1 year ago • 0 comments

Is it a private platform, and a platform specific issue? (i.e. would it break your NDA?)
Then please report your issue in the corresponding extension repository!

Describe the bug (REQUIRED) An immediate mode drawing API was created for an ingame editor. Each frame I clear a list of gameobject ids, then use a factory to create them again in different locations with different positions, tints and scales.

function M.Clear()
	for i = #Points, 1, -1 do
		go.delete(Points[i])
		table.remove(Points, i)
	end
end

function M.Point(_pos, _scale, _col)	
	local id = factory.create("#PointFactory", _pos, nil, nil, _scale)
	Points[#Points+1] = id

	local sprite = msg.url(nil, id, "sprite")
	--go.set(sprite, "tint", _col) <-------------------uncommenting this will cause memory to rise continually. nothing else
end

To Reproduce (REQUIRED) Steps to reproduce the behavior: use profiler for factory create but tint them each time

Expected behavior (REQUIRED) no increasing allocations over time

Defold version (REQUIRED): 1.8.0

Platforms (REQUIRED): Windows 11

hippocoder avatar May 04 '24 17:05 hippocoder