Skip to content

Commit 7db4e6e

Browse files
committed
Release previous scene in transitions before calling onEnterTransitionDidFinish.
Former-commit-id: 3ec7be1
1 parent ea1d44b commit 7db4e6e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cocos2d/CCTransition.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,17 @@ - (void)update:(CCTime)delta
233233
// check for runtime expired
234234
if (_progress >= 1.0f)
235235
{
236-
// exit out scene, and start new scene
236+
// Exit out scene
237237
[_outgoingScene onExit];
238238
if ([CCDirector sharedDirector].sendCleanupToScene) [_outgoingScene cleanup];
239+
_outgoingScene = nil;
240+
241+
242+
// Start incoming scene
239243
[[CCDirector sharedDirector] replaceScene:_incomingScene];
240244
[_incomingScene onEnterTransitionDidFinish];
241245
_incomingScene.paused = _incomingPauseState;
242-
243-
// release scenes
244246
_incomingScene = nil;
245-
_outgoingScene = nil;
246247

247248
return;
248249
}

0 commit comments

Comments
 (0)