Skip to content

CubismMotionSyncCriEngine が予期せず Dispose される事があるのを修正 #6

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

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

ppcuni
Copy link
Contributor

@ppcuni ppcuni commented Jun 27, 2024

複数の Live2D を同時にインスタンス化する際に、一部の CubismMotionSyncCriProcessor の enable を落とした状態でインスタンスを作り、enable が true になることなく Destroy された場合に問題が発生した。
(CubismMotionSyncCriProcessor.MotionSyncAudioInput はボイス再生時まで代入したくないのでインスタンス化直後は無効化するようにしていた。その状態でセリフを喋らない Live2D を登場させて退場させるシーンを作ったら再現した)

上記状況では、CubismMotionSyncCriProcessor の Start が呼ばれる回数と Destroy が呼ばれる回数の対称性が崩れる。
それにより CubismMotionSyncCriEngine.ReferenceCount に不整合が生じ、まだ有効な CubismMotionSyncCriProcessor があるのに CubismMotionSyncEngine_CRI.DisposeEngine が呼ばれてしまい、リップシンクが停止してしまう。

複数の Live2D を同時にインスタンス化する際に、一部の CubismMotionSyncCriProcessor の enable を落とした状態でインスタンスを作り、enable が true になることなく Destroy された場合に問題が発生した。
上記状況では、CubismMotionSyncCriProcessor の Start が呼ばれる回数と Destroy が呼ばれる回数の対称性が崩れる。
それにより CubismMotionSyncCriEngine.ReferenceCount に不整合が生じ、まだ有効な CubismMotionSyncCriProcessor があるのに CubismMotionSyncEngine_CRI.DisposeEngine が呼ばれてしまい、リップシンクが停止してしまう
Copy link
Contributor

@tanakaso-at-live2d-com tanakaso-at-live2d-com left a comment

Choose a reason for hiding this comment

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

@ppcuni
Thank you for pull request and investigation!

As preparation to incorporate this fix, we are suggestion one modification to align with our coding conventions. Once that change is complete, we plan to commit the CHANGELOG to your branch to include it.

…ubismMotionSyncCriProcessor.cs

Co-authored-by: Sohma Tanaka <81139027+tanakaso-at-live2d-com@users.noreply.github.com>
@tanakaso-at-live2d-com
Copy link
Contributor

@ppcuni
We have reviewed the modification.
We'll go ahead and commit the CHANGELOG to incorporate the changes. Thank you for your cooperation!

@wada-at-live2d-com wada-at-live2d-com merged commit 2c29ab1 into Live2D:develop Jul 11, 2024
1 check passed
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.

3 participants