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

AnimatedVisualPlayer destructor bug #4955

Merged
merged 2 commits into from
May 17, 2021
Merged

Conversation

AndrewB330
Copy link
Contributor

This change should fix the internal bug

The problem is that calling IsPlaying(false) inside the AnimatedVisualPlayers destructor causes a crash. Basically, our goal is to reduce a number of things that destructor is doing, ideally nothing. But the problem is that we want to destroy AnimationPlay m_nowPlaying object (if it is alive) as well, but AnimatedVisualPlayer::PlayAsync keeps this object alive, because it holds reference and awaits (co_await *thisPlay;) for it to call CompleteAwaits(). Also we need to release m_batch listener as well, because it holds weak reference to us (line ~130).

So basically, we want to call AnimationPlay ::Complete() but without touching m_owner. But since AnimationPlay calls m_owner only if it is bound to it, we can detach it first, to ensure that we will not call anything in m_owner inside the destructor.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label May 4, 2021
@StephenLPeters StephenLPeters added area-AnimatedVisualPlayer team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels May 4, 2021
@StephenLPeters
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jevansaks jevansaks changed the title AnimatedVisualPlayer destructor bug [32126845] AnimatedVisualPlayer destructor bug May 5, 2021
@ghost
Copy link

ghost commented May 6, 2021

CLA assistant check
All CLA requirements met.

@StephenLPeters
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj ranjeshj merged commit dc62bd9 into microsoft:main May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants