Bug 1592539 - Also null out mMediaStreamRenderer in Unlink. r=bryce
I have observed async calls to the MediaStreamRenderer's mWatchManager::Unwatch() in flight after it was Shutdown(). This would cause an assertion failure in debug. Per the comment we should do the same in Unlink as EndSrcMediaStreamPlayback() without creating new strong refs. This conforms to that instruction. I am not willing to null out the other members at this point, since at least HTMLVideoElement's relies on the selected video track to exist in some cases. Differential Revision: https://phabricator.services.mozilla.com/D87136
This commit is contained in:
@@ -2004,6 +2004,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement,
|
||||
}
|
||||
if (tmp->mMediaStreamRenderer) {
|
||||
tmp->mMediaStreamRenderer->Shutdown();
|
||||
// We null out mMediaStreamRenderer here since Shutdown() will shut down
|
||||
// its WatchManager, and UpdateSrcStreamPotentiallyPlaying() contains a
|
||||
// guard for this.
|
||||
tmp->mMediaStreamRenderer = nullptr;
|
||||
}
|
||||
if (tmp->mMediaStreamTrackListener) {
|
||||
tmp->mSrcStream->UnregisterTrackListener(
|
||||
|
||||
Reference in New Issue
Block a user