Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't trigger onExitTransitionDidStart #6681

Merged
merged 1 commit into from May 14, 2014
Merged

Conversation

minggo
Copy link
Contributor

@minggo minggo commented May 12, 2014

No description provided.

@zifter
Copy link
Contributor

zifter commented May 12, 2014

It does not fix the bug with twice calling onExit().
If you want, I may create pull request where this bug are reproduced.

@minggo
Copy link
Contributor Author

minggo commented May 14, 2014

@zifter
Yep. This PR is just for fix the bug of trigger onExitTransitionDidStart.
I don't want to mix many things in a PR.

About onExit issue.
I think you are right.
I will fix it in other PR.

minggo added a commit that referenced this pull request May 14, 2014
[ci skip] don't trigger onExitTransitionDidStart
@minggo minggo merged commit d46362a into cocos2d:v3 May 14, 2014
@minggo minggo deleted the director-fix branch May 14, 2014 10:25
@minggo
Copy link
Contributor Author

minggo commented May 14, 2014

@zifter
It is better to send me a PR to reproduce it.
Thanks.

@zifter
Copy link
Contributor

zifter commented May 15, 2014

@minggo
I create PR to reproduce it.
#6757
And fix:
#6756

@minggo
Copy link
Contributor Author

minggo commented May 15, 2014

Thanks.

@@ -925,7 +926,6 @@ void Director::purgeDirector()

if (_runningScene)
{
_runningScene->onExitTransitionDidStart();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to understand why this line was removed. It doesn't make much sense to me because onExit will be called without onExistTransitionDidStart being called before it.

I do understand that the other changes were made because onExitTransitionDidStart was called twice, but when purging the director it seems impossible for it to happen, am I right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Methods onExitTransitionDidStart and onEnterTransitionDidFinish must be called only of
Calls to methods onExitTransitionDidStart and onEnterTransitionDidFinish should be only if the transition occurs with the TransitionScene, is't it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand what you are saying, but let's imagine my game is made in a way that most cleanup is made in onExitTransitionDidStart and not on onExit, because I replace scenes using a TransitionScene and I don't want to generate any conflicts between the two scenes. (imagine my nodes use platform-specific services like Text-to-speech, audio recording, etc).

This way, if I purge the director, my onExitTransitionDidStart methods will not be called and I will end up with resources that were not properly cleaned.

Of course I could move all that logic to onEnter/onExit instead of onExitTransitionDidStart/onEnterTransitionDidFinish but it just doesn't seem natural.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants