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

Fix unintended returning to pool with cancelImmediately #557

Merged
merged 6 commits into from
Mar 28, 2024

Conversation

hadashiA
Copy link
Contributor

@hadashiA hadashiA commented Mar 28, 2024

#553

Problem

It was a cancelImmediately issue.

  1. When cancelImmediately is cancelled, the object is returned to the object pool immediately,
  2. MoveNext in the Player Loop is still running even after it is returned to the pool.
  3. if we enter MoveNext in the initialized state, it would probably stop immediately, But if it was canceled immediately and reused on the same frame as the pool, it would not stop, and the elapsed += Time.deltaSpan would be doubly elapsed....

Fix

If cancel Immediately, the return to the pool is abandoned.

NOTE:

  • I thought about delaying the return until MoveNext, but there would be a problem if the return timing is different from the await timing.

@hadashiA hadashiA force-pushed the hadashiA/fix-cancel-immediate branch from 68a99df to a48f11d Compare March 28, 2024 05:46
@hadashiA hadashiA force-pushed the hadashiA/fix-cancel-immediate branch from 6b8762f to 938ddd5 Compare March 28, 2024 06:16
@hadashiA hadashiA merged commit b724a2a into master Mar 28, 2024
4 checks passed
@hadashiA hadashiA deleted the hadashiA/fix-cancel-immediate branch March 28, 2024 06:21
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.

1 participant