storyboard overlayEnded problem, generates stack overflow

I’ve got these scenes

main -> goes directly to mainmenu
mainmenu - after pressing a button goes to game
game - pressing a button brings up popup scene
popup - shows two buttons, resume and mainmenu button. on resume it just closes popup and on mainmenu it closes popup and sets storyboard.state.paused.GoToMainMenu = true which I then back in game scene check for in the -> function scene:overlayEnded( event ) and if true I do this: storyboard.gotoScene( “mainmenu” )

however that genterates this error:
stack overflow stack traceback [C]: in function ‘print’
image: http://i.imgur.com/strO5.png

if I comment out the print line then it complains about gotoScene function:
stack overflow stack traceback [C]: in function ‘gotoScene’
image: http://i.imgur.com/BjOZ2.png

now I thought I’d be smart and add a little delay like this:
timer.performWithDelay(500, jumpToMainMenu, 0)
so perhaps then corona would manage to go back to mainmenu scene, and this is what happens after I run with that modification:

http://i.imgur.com/1pe2w.png

mainmenu enterScene and exitScene are repeatedly called and get in and endless loop.

I can provide code if needed, however I used a barebones templates to test this as I was experiencing this problem in game I’m developing so just to exlcude my game code doing something funny I set up this experiment and found it failed.

Can someone explain if this is a bug or is there workaround this? I need to be able to go to mainmenu after closing popup and it seems as it is right now corona can’t handle that.

How does rest of you do this? I’m thinking perhaps making my own popup instead of using coronas since it seems not to work perfectly. [import]uid: 13099 topic_id: 30159 reply_id: 330159[/import]

Just wanted to throw out a “me too”. This “loop” only happens when I try to put a gotoScene or reloadScene in the overlayEnded callback or a function that is called inside the overlayEnded callback.

Any thoughts on this folks? [import]uid: 92150 topic_id: 30159 reply_id: 121295[/import]

hi, I had to change
timer.performWithDelay(500, jumpToMainMenu, 0)
to
timer.performWithDelay(500, jumpToMainMenu, 1)

1 means it will call it just once, 0 means it will call it forever.

Doing that solves the problem of looping, however I think there is a bug in corona when trying to directly call another scene directly from overlayEnded function as you could see by my screenshots. So best thing is to create a timer and wait for 100 ms before calling function that initiates jump to another scene. [import]uid: 13099 topic_id: 30159 reply_id: 121313[/import]

Just wanted to throw out a “me too”. This “loop” only happens when I try to put a gotoScene or reloadScene in the overlayEnded callback or a function that is called inside the overlayEnded callback.

Any thoughts on this folks? [import]uid: 92150 topic_id: 30159 reply_id: 121295[/import]

hi, I had to change
timer.performWithDelay(500, jumpToMainMenu, 0)
to
timer.performWithDelay(500, jumpToMainMenu, 1)

1 means it will call it just once, 0 means it will call it forever.

Doing that solves the problem of looping, however I think there is a bug in corona when trying to directly call another scene directly from overlayEnded function as you could see by my screenshots. So best thing is to create a timer and wait for 100 ms before calling function that initiates jump to another scene. [import]uid: 13099 topic_id: 30159 reply_id: 121313[/import]