Fix sequence hold handle - #256
Conversation
|
|
e0ec4f4 to
a2b2bb9
Compare
|
I will merge it into my fork <3 |
|
Merged the PR. Thank you!!! |
|
Thank you for vietdungdev's investigation! The original
Therefore, I believe there are two possible interpretations for the original intent of placing
I chose interpretation 1 and opted to retain the IsValid check. This decision was simply based on my incomplete understanding of the library as a whole, opting for a safer approach that seemed to minimize review burden. |
|
@amenonegames In UpdateRunner.cs In MotionManager.cs This means that in the OnComplete function, if the handle is not IsPreserved, IsActive will always be false because state.Status is now MotionStatus.Completed. By modifying the function as below, the new logic will be to check handle.IsActive() to determine if this handle is IsPreserved. |
The contributor who discovered the issue is amenonegames here: annulusgames#256
|
@nuskey8 |
|
If this commit is merged, it will automatically release the sequence's handles even if handle.Preserved() was called previously, which is clearly contrary to the original design. |

Issue1 : early return
The
OnCompletemethod of the Sequence contained an early return statement:if (!handle.IsActive()) return;. However, sinceOnCompleteis always called after the State transitions to Complete, the early return clause was always executed.Issue2 : Preserved handle
Additionally, when adding a handle to the sequence, the Preserve flag was automatically set.
As a result, handles remained in memory even after the sequence execution completed.
Resolution1 : early return
I added an
IsValidmethod that checks only whether the handle's version is appropriate and whether the handle exists in storage, without referencing the state.The early return clause in
Sequence.OnCompletewas replaced with thisIsValidcheck.Resolution2 : Preserved handle
Additionally, upon the sequence's overall completion, we modified the behavior to cancel all handles within the sequence and discard preserved handles.
Verification
Verified execution using a combination of Join/Append/AppendInterval.
The debug screen results at the time of Motion completion are as follows.
※ I tested it in following repository.
https://github.com/amenonegames/LitMotionSequenceTest
Related Issue
#209