Questions regarding Overlay scene

Hi

I have some questions regarding Overlay scene

I use the Overlay scene in my game for pause the level when player tap the “Pause” or “back” buttons

In the Pause overlay scene I have two options, return back to the level or exit to the “main” scene.

Here the code I use in the relevant overlay scene

function scene:hide( event )

local sceneGroup         = self.view

local phase         = event.phase

local parent = event.parent

system.activate( “multitouch” )

if( phase == “will” ) then

transition.to( rectBg, { alpha = 0, time = 300 } )

if (exitLevel == 0) then

Runtime:removeEventListener( “key”, onKeyEvent )

parent:resumeGame ()

end

elseif( phase == “did” ) then

if (exitLevel == 1) then

composer.removeScene( “level”…levelData.settings.currentLevel )

end

end

end

In the level scene I added some debug print lines to check if scene:hide and scene:destroy are been executed when the game exit to the main scene.

I found that the scene:hide is not  executed, is this an expected behavior of the composer?

I’m calling from the level scene:hide some functions to clean the timers, sound and some display objects.

I notice that when running the game on the phone, sometimes the objects (sceneGroup) from the level I exit are still exist in the new level.

I don’t see this issue in the SDK simulator.

Could it be that the behavior I described above are associated with this problem?

Regards,

Guy