?:0: attempt to call a string value on Memory Warning

I was getting ?:0: attempt to call a string value on iPad every time I got a memory warning, and eventually my app crash after having low memory.

After searching endlessy on my code, every line for where I might be calling a string, I tried a new thing…
I added this to main.lua:

local memorybutton = display.newText("ISSUE MEMORY WARNING!", 0, 0, native.systemFontBold, 35);  
memorybutton.x = display.contentCenterX;  
memorybutton.y = 30;  
memorybutton:setTextColor ( 255, 0, 0 );  
  
local function memoryButtonToFront()  
 memorybutton:toFront();  
end  
  
local function issueMemoryWarning( event )  
 if event.phase == "ended" then  
 Runtime:dispatchEvent( { name="memoryWarning"} );  
 end  
end  
  
memorybutton:addEventListener( "touch", issueMemoryWarning );  
  
timer.performWithDelay( 500, memoryButtonToFront, 0 );  

Then I kept clicking on this button as the game run…

Then I noticed, that after a couple of scene changed (I am using storyboard) I start to get:

“?:0: attempt to call a string value”

every time I click the button… Even on the simulator.

Thus it dawned to me that ?:0: was NOT because it was my own faulty code on the device… ?:0: is because it is Corona own code that is broken, not my code.

So please fix that, because this is causing some very severe crashes (Sometimes it cause device-wide crashes, more than one user reported my application crashing EVERYTHING in the device, and when I reproduced the crash on my own devices, this now dreaded error to me (?:0: attempt to call a string value on Memory Warning) happened some time before the crash. [import]uid: 142895 topic_id: 30302 reply_id: 330302[/import]

More details:

My game has a map screen from where you can access all other storyboard scenes somehow.

I noticed this:

Game start… (no scene yet).

storyboard loads map.

everything works fine.

storyboard loads another scene.

everything works fine.

return to map.

everything works fine.

go to other scene how many times I want.

everything works fine.

return to map how many times I want.

everything works fine.

load any other scene

error happens.

Another possible sequence:

load map.

works fine.

load a scene from the map.

works fine.

load anything else from the previous scene.

error.
Thus I can see a pattern that only 2 storyboard scenes can be loaded, any time I load any more scenes the error happens. [import]uid: 142895 topic_id: 30302 reply_id: 121372[/import]

Another info…

I disabled autopurge.

I get this message:

Low memory warning recieved (auto-purging is disabled). You should manually purge un-needed scenes at this time.
The thing is: I get this message all the time, I can load any amount of scenes I want without getting the error I mentioned above. [import]uid: 142895 topic_id: 30302 reply_id: 121376[/import]

One last info I believe:

I tried to load other scenes than the ones in the first test.

And the bug still happens consistently after 3 scenes are loaded…

Letting me conclude that when a memory warning happens, the code to purge the scene seen since most time hits a bug.

And the version I am using (I forgot to mention before!) is the lastest stable. [import]uid: 142895 topic_id: 30302 reply_id: 121380[/import]

Would you please submit a bug report with us? (Link on the top-right of the page.)
Please include a simple, reproducible test case that demonstrates the problem. I bet the Xcode/iOS Simulator can help you trigger this by using Menu->Hardware->Simulator Memory Warning.

[import]uid: 7563 topic_id: 30302 reply_id: 121401[/import]

More details:

My game has a map screen from where you can access all other storyboard scenes somehow.

I noticed this:

Game start… (no scene yet).

storyboard loads map.

everything works fine.

storyboard loads another scene.

everything works fine.

return to map.

everything works fine.

go to other scene how many times I want.

everything works fine.

return to map how many times I want.

everything works fine.

load any other scene

error happens.

Another possible sequence:

load map.

works fine.

load a scene from the map.

works fine.

load anything else from the previous scene.

error.
Thus I can see a pattern that only 2 storyboard scenes can be loaded, any time I load any more scenes the error happens. [import]uid: 142895 topic_id: 30302 reply_id: 121372[/import]

Another info…

I disabled autopurge.

I get this message:

Low memory warning recieved (auto-purging is disabled). You should manually purge un-needed scenes at this time.
The thing is: I get this message all the time, I can load any amount of scenes I want without getting the error I mentioned above. [import]uid: 142895 topic_id: 30302 reply_id: 121376[/import]

One last info I believe:

I tried to load other scenes than the ones in the first test.

And the bug still happens consistently after 3 scenes are loaded…

Letting me conclude that when a memory warning happens, the code to purge the scene seen since most time hits a bug.

And the version I am using (I forgot to mention before!) is the lastest stable. [import]uid: 142895 topic_id: 30302 reply_id: 121380[/import]

Would you please submit a bug report with us? (Link on the top-right of the page.)
Please include a simple, reproducible test case that demonstrates the problem. I bet the Xcode/iOS Simulator can help you trigger this by using Menu->Hardware->Simulator Memory Warning.

[import]uid: 7563 topic_id: 30302 reply_id: 121401[/import]