mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
Bug 1593739 - Shut down the watch manager during Unlink to prevent future notify tasks. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D51906 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2990929969
commit
a91244fa43
@ -1692,6 +1692,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement,
|
||||
nsGenericHTMLElement)
|
||||
tmp->mWatchManager.Shutdown();
|
||||
tmp->RemoveMutationObserver(tmp);
|
||||
if (tmp->mSrcStream) {
|
||||
// Need to EndMediaStreamPlayback to clear mSrcStream and make sure
|
||||
@ -5074,17 +5075,20 @@ void HTMLMediaElement::EndSrcMediaStreamPlayback() {
|
||||
mFirstFrameListener = nullptr;
|
||||
|
||||
if (mMediaStreamRenderer) {
|
||||
mWatchManager.Unwatch(mPaused,
|
||||
&HTMLMediaElement::UpdateSrcStreamPotentiallyPlaying);
|
||||
mWatchManager.Unwatch(mReadyState,
|
||||
&HTMLMediaElement::UpdateSrcStreamPotentiallyPlaying);
|
||||
mWatchManager.Unwatch(mSrcStreamPlaybackEnded,
|
||||
&HTMLMediaElement::UpdateSrcStreamPotentiallyPlaying);
|
||||
mWatchManager.Unwatch(
|
||||
mSrcStreamPlaybackEnded,
|
||||
&HTMLMediaElement::UpdateSrcStreamReportPlaybackEnded);
|
||||
mWatchManager.Unwatch(mMediaStreamRenderer->CurrentGraphTime(),
|
||||
&HTMLMediaElement::UpdateSrcStreamTime);
|
||||
if (!mWatchManager.IsShutdown()) {
|
||||
mWatchManager.Unwatch(
|
||||
mPaused, &HTMLMediaElement::UpdateSrcStreamPotentiallyPlaying);
|
||||
mWatchManager.Unwatch(
|
||||
mReadyState, &HTMLMediaElement::UpdateSrcStreamPotentiallyPlaying);
|
||||
mWatchManager.Unwatch(
|
||||
mSrcStreamPlaybackEnded,
|
||||
&HTMLMediaElement::UpdateSrcStreamPotentiallyPlaying);
|
||||
mWatchManager.Unwatch(
|
||||
mSrcStreamPlaybackEnded,
|
||||
&HTMLMediaElement::UpdateSrcStreamReportPlaybackEnded);
|
||||
mWatchManager.Unwatch(mMediaStreamRenderer->CurrentGraphTime(),
|
||||
&HTMLMediaElement::UpdateSrcStreamTime);
|
||||
}
|
||||
mMediaStreamRenderer->Shutdown();
|
||||
mMediaStreamRenderer = nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user