come to think of it, admob only runs on device and not in the simulator, so I’d start there!
I was going to go there. There are things that run on the device that don’t in the simulator from camera/photo album operations, to microphone usage to plugins.
Plugins would be a great place to start looking.
Rob
Thanks for the tip Rob.
The only thing I am using is Dusk which is different to the other scenes (which are working fine btw). Just the level scene is making this problem. There I have Dusk and Physics in use.
I will start looking into this two.
I wonder if the admob plugin features can cause this behavior?
I am requiring the plugin in main.lua and then use it globally (also the listener).
I load and display the ads in my level scene file where I have the problems with the 500KB adding up to the system memory.
When doing: admob.load(…) and then admob.show when it has loaded… is this maybe is adding up to memory because I am using admob globally?
UPDATE: I now changed the admob plugin usage and requiring to just empty functions to test it. Something like this:
admob={}
admob.init=function() end
…
And I still have the same problem on device.
One more question I have:
When I change the scene on and off and on until I get to about 64 MB of system memory usage on device things start to lag and get slow. Isn’t this a sign some running code is added up not just “unused” system memory? Could the lag be an indicator to circle the problem maybe?
That absolutely sound l like you are on the right track. I avoid global like the plague myself, although there are some situations when it is necessary and practically harmless.
Is there a scenario for using images in a scene, where ONLY the system memory on the device is showing a leak and it’s working fine on the simulator?
I now have looked into all the global stuff and admob and more.
But it still is happening on device. And the leak size of 500KB is showing it should be something big, right? So I now guess it is some image space maybe? What else can cause a 500KB increase in system memory every scene change and ONLY on the device?
I don’t know where to look at anymore. 
re your question. No. Composer should behave the same in simulator and on device.
Question:
So, you turned off all features that were not available or being used in the simulator and you see a difference in the way it runs/uses memory?
For Fun:
Try setting these composer settings at the top of main.
local composer = require "composer composer.isDebug = true -- more messaging to console showing what composer is doing composer.recycleOnSceneChange = true
Now, re-test in the simulator then on the device.
After that…
You may need to pay someone (or trade work with someone) to look at your game if you can’t figure it out and can’t live with it.
Thank you for the composer info.
I did use it and couldn’t find anything wrong BUT I afterwards was able to circle a function which was behaving differently on simulator and device. When looking into it I noticed there maybe are some graphics created which are not deleted properly with scene change.
I first found this strange because if so, this should be a problem on both the simulator AND on device, right? So I created a function for deleting the graphics before scene change to make sure. Testing this still showed a difference on the device, so I looked closer and found this:
I was using text display objects I created like this using the graphic image and created them “on” the image itself:
local gfx={} local groups={group} local createimages=function() gfx.btn\_nextLVL=display.newImage("myimage.png",256,256) gfx.btn\_nextLVL.theTextShadow=display.newText(options) gfx.btn\_nextLVL.theText=display.newText(options) -- put all in a group groups.group=display.newGroup() groups.group:insert(gfx.btn\_nextLVL) groups.group:insert(gfx.btn\_nextLVL.theTextShadow) groups.group:insert(gfx.btn\_nextLVL.theText) end
I later removed the graphics with a scene change by calling a function which is doing this:
for k,v in pairs( gfx ) do if v then display.remove ( v ) v=nil if gfx[k] then display.remove (gfx[k]) gfx[k]=nil end end if #gfx then for x=#gfx,1,-1 do if gfx[x] then display.remove(gfx[x]) gfx[x]=nil end end end end for k,v in pairs( groups ) do if v then display.remove ( v ) v=nil if groups[k] then display.remove (groups[k]) groups[k]=nil end end if #groups then for x=#groups,1,-1 do if groups[x] then display.remove(groups[x]) groups[x]=nil end end end end
This seems to work on the simulator BUT not on the device because it seems (after testing) the memory for the text objects is not removed correctly on the device. When doing this for example (shown for a specific button image) for all images which are using this kind of display.newText objects:
if gfx.btn\_nextLVL then if gfx.btn\_nextLVL.theTextShadow then display.remove(gfx.btn\_nextLVL.theTextShadow) gfx.btn\_nextLVL.theTextShadow=nil end if gfx.btn\_nextLVL.theText then display.remove(gfx.btn\_nextLVL.theText) gfx.btn\_nextLVL.theText=nil end display.remove(gfx.btn\_nextLVL) gfx.btn\_nextLVL=nil end
This will remove more memory on device than it did before without this lines!
Is this possible? Can someone please test this and confirm?
I’m right now looking through all my code for this kind of added display.objects (text and other) to get my system memory leak removed. A big part already is now!
But the big question remains: Why is this only happening on device and not the simulator?
Can you reduce this to a simple test app that I can share with our engineers?
Rob
Can I send you a personal link somehow?
If you file a bug report it will only go to us.
But you should be able to create a simple demo project that has minimal code without sharing your whole project.
Rob
I have created a file (zip) with a small project based on the composer sample file from the corona samples. Can I send this directly somehow?
Thanks for the link. I have uploaded the file with a description.
Can you verify that the sample you uploaded has the problem? I can’t ask an engineer to look into this if it doesn’t have the problem. Please help us help you.
Rob
Please note I just send another file version because I forgot to comment out the “solution” for the problem in the scene2 file.
I can not test it on device right now. I will update here if I have tested the sample on device! Thanks for your help!
Maybe someone wants to test it on device?.. if so, I just have changed some things in the composer sample from the sample Corona files.
Here are the changed files:
The scene2.lua file:
--------------------------------------------------------------------------------- -- -- scene2.lua -- --------------------------------------------------------------------------------- local composer = require( "composer" ) local scene = composer.newScene() local image, text1, text2, text3, memTimer -- added module -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* local module=require ("load\_module\_stuff") local initmodulestuff=module.initmodulestuff local gfx=module.gfx local groups=module.groups -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* local function onSceneTouch( self, event ) if event.phase == "began" then composer.gotoScene( "scene3", "fade", 400 ) return true end end function scene:create( event ) local sceneGroup = self.view image = display.newImage( "bg2.jpg" ) image.x = display.contentCenterX image.y = display.contentCenterY sceneGroup:insert( image ) image.touch = onSceneTouch text1 = display.newText( "Scene 2", 0, 0, native.systemFontBold, 24 ) text1:setFillColor( 255 ) text1.x, text1.y = display.contentWidth \* 0.5, 50 sceneGroup:insert( text1 ) text2 = display.newText( "MemUsage: ", 0, 0, native.systemFont, 16 ) text2:setFillColor( 255 ) text2.x, text2.y = display.contentWidth \* 0.5, display.contentHeight \* 0.5 sceneGroup:insert( text2 ) text3 = display.newText( "Touch to continue.", 0, 0, native.systemFontBold, 18 ) text3:setFillColor( 255 ); text3.isVisible = false text3.x, text3.y = display.contentWidth \* 0.5, display.contentHeight - 100 sceneGroup:insert( text3 ) print( "\n2: create event" ) end function scene:show( event ) local phase = event.phase if "did" == phase then print( "2: show event, phase did" ) -- remove previous scene's view composer.removeScene( "scene1" ) -- Update Lua memory text display local showMem = function() image:addEventListener( "touch", image ) text3.isVisible = true text2.text = text2.text .. string.format("%.2g", collectgarbage("count")/1000) .. "MB" text2.x = display.contentWidth \* 0.5 end memTimer = timer.performWithDelay( 1000, showMem, 1 ) -- we now init the module -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* local sceneGroup = self.view initmodulestuff (sceneGroup) -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* end end function scene:hide( event ) local phase = event.phase if "will" == phase then print( "2: hide event, phase will" ) -- remove touch listener for image image:removeEventListener( "touch", image ) -- cancel timer timer.cancel( memTimer ); memTimer = nil; -- reset label text text2.text = "MemUsage: " end end function scene:destroy( event ) print( "((destroying scene 2's view))" ) -- the following code is making a difference ONLY on device when active and not the simulator: -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* --[[ if gfx.circleobj then if gfx.circleobj.mytext1 then display.remove(gfx.circleobj.mytext1) gfx.circleobj.mytext1=nil end if gfx.circleobj.mytext2 then display.remove(gfx.circleobj.mytext2) gfx.circleobj.mytext2=nil end if gfx.circleobj.mytext3 then display.remove(gfx.circleobj.mytext3) gfx.circleobj.mytext3=nil end if gfx.circleobj.mytext4 then display.remove(gfx.circleobj.mytext4) gfx.circleobj.mytext4=nil end end --]] -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* -- we now remove the graphics from the module for k,v in pairs( gfx ) do if v then display.remove ( v ) v=nil if gfx[k] then display.remove (gfx[k]) gfx[k]=nil end end if #gfx then for x=#gfx,1,-1 do if gfx[x] then display.remove(gfx[x]) gfx[x]=nil end end end end if groups then if #groups then for x=#groups,1,-1 do if groups[x] then display.remove(groups[x]) groups[x]=nil end end end for k,v in pairs( groups ) do if v then display.remove ( v ) v=nil if groups[k] then display.remove (groups[k]) groups[k]=nil end end end end end --------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) --------------------------------------------------------------------------------- return scene
And the module file I have added:
load_module_stuff.lua
-- the module for scene 2 local mod={} local gfx={circleobj} local groups={gui} local createtextfunction = function() local textoptions= { text = "My Circle Text", fontSize = 12, align = "left" -- Alignment parameter } -- adding some text direct to the circle gfx.circleobj.mytext1=display.newText(textoptions) gfx.circleobj.mytext2=display.newText(textoptions) gfx.circleobj.mytext3=display.newText(textoptions) gfx.circleobj.mytext4=display.newText(textoptions) gfx.circleobj.mytext1.x=64 gfx.circleobj.mytext1.y=96 gfx.circleobj.mytext2.x=64 gfx.circleobj.mytext2.y=106 gfx.circleobj.mytext3.x=64 gfx.circleobj.mytext3.y=116 gfx.circleobj.mytext4.x=64 gfx.circleobj.mytext4.y=126 groups.gui:insert(gfx.circleobj.mytext1) groups.gui:insert(gfx.circleobj.mytext2) groups.gui:insert(gfx.circleobj.mytext3) groups.gui:insert(gfx.circleobj.mytext4) end local initmodulestuff=function(sceneGroup) groups.gui=display.newGroup( ) gfx.circleobj=display.newCircle(0,0,28) -- position stuff gfx.circleobj.x=64 gfx.circleobj.y=64 groups.gui:insert(gfx.circleobj) createtextfunction() sceneGroup:insert (groups.gui) end mod.gfx=gfx mod.groups=groups mod.initmodulestuff=initmodulestuff return mod
I will test it on device asap but it will take some days I guess.
I’ve never been happy with the Composer sample app because if you run it, it appears to be leaking memory. I took a few minutes and made a few changes to it today. Here is one of the snippets that I changed:
function scene:show( event ) local phase = event.phase if "did" == phase then print( "1: show event, phase did" ) -- remove previous scene's view composer.removeScene( "scene4" ) collectgarbage("collect") -- #1 -- Update Lua memory text display local showMem = function() image:addEventListener( "touch", image ) text3.isVisible = true text2.text = text2.text .. string.format("%.3g MB, %.3g MB", collectgarbage("count")/1024, system.getInfo("textureMemoryUsed")/(1024 \* 1024)) -- #2 text2.x = display.contentWidth \* 0.5 end memTimer = timer.performWithDelay( 1000, showMem, 1 ) end end function scene:hide( event ) local phase = event.phase if "will" == phase then print( "1: hide event, phase will" ) -- remove touch listener for image image:removeEventListener( "touch", image ) -- cancel timer timer.cancel( memTimer ); memTimer = nil; -- reset label text text2.text = "MemUsage: " elseif "did" == phase then composer.removeScene("scene1") -- #3 end end
There are three changes:
#1 – I force collect garbage after removing the previous scene. Lua garbage collection doesn’t happen on a fixed timer. Lua frees up memory when it feels it needs to. Assuming that memory is freed after 1 second after removing a scene is just a bad assumption on our part. To baseline things, now when the scene is removed, garbage is collected right away.
While I would highly recommend letting Lua collect garbage on its own schedule if you’re hunting a memory leak you have to control the collection yourself.
#2 – The scene only prints Lua memory, not texture memory. display.newCircle/newText are consuming texture memory as well as Lua memory. I added printing out texture memory as well. I increased the number of decimal places to three and I corrected the Megabyte calculation. Computers use 1024 and not 1000. Metric is a power of 10 measure, Memory/Storage etc. is a power of 2 measure. Some other general clean up was added to the command to better demonstrate the power of string.format.
#3 – You can successfully remove the current scene but only in the scene:hide() function during the “did” phase. It’s a bit redundant with the removal of the previous scene in scene:show(), but I just wanted to make sure the scene’s getting removed and show this technique.
When running it on the simulator, memory is perfect. Each scene reports an effective same amount of memory. On my iPhone 10 (iOS 12.1), the memory per scene is actually a little less than the simulator, but I can run through the scenes multiple times and not see a drop of memory increase.
When testing this case, when using this sample, I would recommend adding at least changes #1 and #2 above. Adding #3 won’t hurt.
I don’t see a memory leak.
Rob
Thanks for all your help!
I finally found the part in my code which is leaking about 100KB when a scene is reloaded or another loaded and the first one loaded again.
Here is the “problematic” function:
RetryMission = function(Button) -- checking for bought game: local file = io.open( \_G.path, "r" ) -- we first ask if the level should be left and progress lost AND if so, we have to save the current info.. or? local onComplete=function(event) -- Handler that gets notified when the alert closes if ( event.action == "clicked" ) then local i = event.index if ( i == 1 ) then -- Do nothing; dialog will simply dismiss -- but we have to move back the button appearance now: if Button then --Button:setFrame(1) Button.y=Button.y-2 end else composer.state.nextscene="textscreen" -- the same "level" is now startd again -- save current stats: if \_G.generatedZufallsMap==1 or \_G.generatedEndlessTestMap==1 then -- do nothing in random map else loadsave.saveTable(MyLevelUnlockInfo,\_G.levelInfoFileName) end --composer.state.nextscene="textscreen" func.deleteGraphics() \_G.LoadnextsceneFunc ("in") end end end -- we check the language and then show the correct texts: local language = system.getPreference( "locale", "language") -- new in version 2.3 we aded the timer as local if \_G.globallanguage=="de" then local do1=performWithDelay(1,function() native.showAlert("Mission abbrechen?", "Möchtest Du die Mission wirklich verlassen?",{ "Nein", "JA!" },onComplete) end,1) elseif \_G.globallanguage=="fr" then local do1=performWithDelay(1,function() native.showAlert("Voulez-vous vraiment quitter la Mission?", "Cliquez sur OUI et quitter la mission.",{ "Non", "OUI!" },onComplete) end,1) elseif \_G.globallanguage=="it" then local do1=performWithDelay(1,function() native.showAlert("Vuoi davvero lasciare la missione?", "Fare clic su Sì e lasciare la missione.",{ "No", "Sì!" },onComplete) end,1) elseif \_G.globallanguage=="es" then local do1=performWithDelay(1,function() native.showAlert("De verdad quieres salir de la Misión?", "Haga clic en SÍ y dejar la misión.",{ "No", "SÍ!" },onComplete) end,1) elseif \_G.globallanguage=="no" then local do1=performWithDelay(1,function() native.showAlert("Avbryt oppdrag?", "Vil du virkelig forlate oppdraget?",{ "Nei!", "Ja!" },onComplete) end,1) elseif \_G.globallanguage=="nl" then local do1=performWithDelay(1,function() native.showAlert("Missie annuleren?", "Wil je echt de missie verlaten?",{ "Nee!", "Yes!" },onComplete) end,1) elseif \_G.globallanguage=="dk" then local do1=performWithDelay(1,function() native.showAlert("Annuller mission?", "Vil du virkelig forlade missionen?",{ "Nej!", "Ja!" },onComplete) end,1) elseif \_G.globallanguage=="se" then local do1=performWithDelay(1,function() native.showAlert("Avbryt uppdrag?", "Vill du verkligen lämna uppdraget?",{ "Nej!", "Yes!" },onComplete) end,1) elseif \_G.globallanguage=="fi" then local do1=performWithDelay(1,function() native.showAlert("Peruuta tehtävä?", "Haluatko todella lähteä lähetystyöstä?",{ "Ei!", "Kyllä!" },onComplete) end,1) elseif \_G.globallanguage=="ru" then local do1=performWithDelay(1,function() native.showAlert("Вы действительно хотите покинуть миссию?", "Нажмите Да! и оставить миссию.",{ "Нет", "Да!" },onComplete) end,1) elseif \_G.globallanguage=="pt" then local do1=performWithDelay(1,function() native.showAlert("Cancelar missão?", "Você realmente quer deixar a missão?",{ "Não!", "Sim!" },onComplete) end,1) elseif \_G.globallanguage=="tr" then local do1=performWithDelay(1,function() native.showAlert("Görevi iptal et?", "Görevi terketmek gerçekten istiyor musun?",{ "Hayır!", "Evet!" },onComplete) end,1) elseif \_G.globallanguage=="ja" then local do1=performWithDelay(1,function() native.showAlert("あなたは本当にミッションを残したいですか?", "[はい]をクリックします!そして、使命を残します。",{ "まさか", "うん!" },onComplete) end,1) elseif \_G.globallanguage=="cn" then local do1=performWithDelay(1,function() native.showAlert("取消任务?", "你真的想离开这个任务吗?",{ "不!", "是的!" },onComplete) end,1) elseif \_G.globallanguage=="kr" then local do1=performWithDelay(1,function() native.showAlert("임무를 취소 하시겠습니까?", "정말로 사명을 떠나고 싶니?",{ "안돼!", "예!" },onComplete) end,1) elseif \_G.globallanguage=="pl" then local do1=performWithDelay(1,function() native.showAlert("Anulować misję?", "Czy naprawdę chcesz opuścić misję?",{ "Nie!", "Tak!" },onComplete) end,1) elseif \_G.globallanguage=="cz" then local do1=performWithDelay(1,function() native.showAlert("Zrušit mise?", "Opravdu chcete opustit misi?",{ "Ne!", "Ano!" },onComplete) end,1) elseif \_G.globallanguage=="vn" then local do1=performWithDelay(1,function() native.showAlert("Huỷ nhiệm vụ?", "Bạn có thực sự muốn rời nhiệm vụ?",{ "Không!", "Có!" },onComplete) end,1) else local do1=performWithDelay(1,function() native.showAlert("Cancel mission?", "Do you really want to leave the actual mission?",{ "No", "YES!" },onComplete) end,1) end --[[ composer.state.nextscene="textscreen" func.deleteGraphics() \_G.LoadnextsceneFunc ("in") --]] end
The strange part: When now NOT using the native.showAlert and commenting in the last part of the function while commenting out all the native popup code, like shown below… the leak disappears!
Please note this only happens on the device (iPhone6) anyway… and was not a problem on the simulator!
RetryMission = function(Button) -- checking for bought game: local file = io.open( \_G.path, "r" ) --[[ -- we first ask if the level should be left and progress lost AND if so, we have to save the current info.. or? local onComplete=function(event) -- Handler that gets notified when the alert closes if ( event.action == "clicked" ) then local i = event.index if ( i == 1 ) then -- Do nothing; dialog will simply dismiss -- but we have to move back the button appearance now: if Button then --Button:setFrame(1) Button.y=Button.y-2 end else composer.state.nextscene="textscreen" -- the same "level" is now startd again -- save current stats: if \_G.generatedZufallsMap==1 or \_G.generatedEndlessTestMap==1 then -- do nothing in random map else loadsave.saveTable(MyLevelUnlockInfo,\_G.levelInfoFileName) end --composer.state.nextscene="textscreen" func.deleteGraphics() \_G.LoadnextsceneFunc ("in") end end end -- we check the language and then show the correct texts: local language = system.getPreference( "locale", "language") -- new in version 2.3 we aded the timer as local if \_G.globallanguage=="de" then local do1=performWithDelay(1,function() native.showAlert("Mission abbrechen?", "Möchtest Du die Mission wirklich verlassen?",{ "Nein", "JA!" },onComplete) end,1) elseif \_G.globallanguage=="fr" then local do1=performWithDelay(1,function() native.showAlert("Voulez-vous vraiment quitter la Mission?", "Cliquez sur OUI et quitter la mission.",{ "Non", "OUI!" },onComplete) end,1) elseif \_G.globallanguage=="it" then local do1=performWithDelay(1,function() native.showAlert("Vuoi davvero lasciare la missione?", "Fare clic su Sì e lasciare la missione.",{ "No", "Sì!" },onComplete) end,1) elseif \_G.globallanguage=="es" then local do1=performWithDelay(1,function() native.showAlert("De verdad quieres salir de la Misión?", "Haga clic en SÍ y dejar la misión.",{ "No", "SÍ!" },onComplete) end,1) elseif \_G.globallanguage=="no" then local do1=performWithDelay(1,function() native.showAlert("Avbryt oppdrag?", "Vil du virkelig forlate oppdraget?",{ "Nei!", "Ja!" },onComplete) end,1) elseif \_G.globallanguage=="nl" then local do1=performWithDelay(1,function() native.showAlert("Missie annuleren?", "Wil je echt de missie verlaten?",{ "Nee!", "Yes!" },onComplete) end,1) elseif \_G.globallanguage=="dk" then local do1=performWithDelay(1,function() native.showAlert("Annuller mission?", "Vil du virkelig forlade missionen?",{ "Nej!", "Ja!" },onComplete) end,1) elseif \_G.globallanguage=="se" then local do1=performWithDelay(1,function() native.showAlert("Avbryt uppdrag?", "Vill du verkligen lämna uppdraget?",{ "Nej!", "Yes!" },onComplete) end,1) elseif \_G.globallanguage=="fi" then local do1=performWithDelay(1,function() native.showAlert("Peruuta tehtävä?", "Haluatko todella lähteä lähetystyöstä?",{ "Ei!", "Kyllä!" },onComplete) end,1) elseif \_G.globallanguage=="ru" then local do1=performWithDelay(1,function() native.showAlert("Вы действительно хотите покинуть миссию?", "Нажмите Да! и оставить миссию.",{ "Нет", "Да!" },onComplete) end,1) elseif \_G.globallanguage=="pt" then local do1=performWithDelay(1,function() native.showAlert("Cancelar missão?", "Você realmente quer deixar a missão?",{ "Não!", "Sim!" },onComplete) end,1) elseif \_G.globallanguage=="tr" then local do1=performWithDelay(1,function() native.showAlert("Görevi iptal et?", "Görevi terketmek gerçekten istiyor musun?",{ "Hayır!", "Evet!" },onComplete) end,1) elseif \_G.globallanguage=="ja" then local do1=performWithDelay(1,function() native.showAlert("あなたは本当にミッションを残したいですか?", "[はい]をクリックします!そして、使命を残します。",{ "まさか", "うん!" },onComplete) end,1) elseif \_G.globallanguage=="cn" then local do1=performWithDelay(1,function() native.showAlert("取消任务?", "你真的想离开这个任务吗?",{ "不!", "是的!" },onComplete) end,1) elseif \_G.globallanguage=="kr" then local do1=performWithDelay(1,function() native.showAlert("임무를 취소 하시겠습니까?", "정말로 사명을 떠나고 싶니?",{ "안돼!", "예!" },onComplete) end,1) elseif \_G.globallanguage=="pl" then local do1=performWithDelay(1,function() native.showAlert("Anulować misję?", "Czy naprawdę chcesz opuścić misję?",{ "Nie!", "Tak!" },onComplete) end,1) elseif \_G.globallanguage=="cz" then local do1=performWithDelay(1,function() native.showAlert("Zrušit mise?", "Opravdu chcete opustit misi?",{ "Ne!", "Ano!" },onComplete) end,1) elseif \_G.globallanguage=="vn" then local do1=performWithDelay(1,function() native.showAlert("Huỷ nhiệm vụ?", "Bạn có thực sự muốn rời nhiệm vụ?",{ "Không!", "Có!" },onComplete) end,1) else local do1=performWithDelay(1,function() native.showAlert("Cancel mission?", "Do you really want to leave the actual mission?",{ "No", "YES!" },onComplete) end,1) end --]] composer.state.nextscene="textscreen" func.deleteGraphics() \_G.LoadnextsceneFunc ("in") end
Do you have an idea why the first function is leaking about 100KB each scene change while the second isn’t?
It all is local and should be removed on device, right? So what is going on here?
Any help welcome!