Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Something wrong with AlertDialog vs Garbage collection — Gideros Forum

Something wrong with AlertDialog vs Garbage collection

RickyngkRickyngk Member
edited February 2013 in General questions
Please see my code below:
local myDialog = nil
local frame_counter = 0
 
function stopDialog()
	if myDialog then
		myDialog:hide()
		myDialog = nil
	end
 
end
 
function startDialog()
	stopDialog()
	myDialog = AlertDialog.new("This is my title", "And my message", "Cancel")
	myDialog:show()
end
 
 
function _OnEnterFrame()
	if frame_counter == 0 then
		startDialog()
	elseif frame_counter == 100 then
		stopDialog()
	end
	frame_counter = frame_counter + 1
	collectgarbage()
end
 
stage:addEventListener(Event.ENTER_FRAME, _OnEnterFrame, self)
Gideros emulator (iPad, iPhone) crashed, fixed by remove "collectgarbage()" or "myDialog = nil"

Something wrong with AlertDialog vs Garbage collection ?

Comments

Sign In or Register to comment.