Bug 1536156 - Stop doing EndCloningVisually in Unlink. r=mconley

Unlink must not cause an AddRef on the unlinked object, or it is at risk of
leaking. See 1593739 for an example of where this happens.

EndCloningVisually is dangerous in that it tries to do more than just unlink the
video element. It does AddRef in NotifyUAWidgetSetupOrChange, so that must be
avoided.

Previous patches to this bug make sure that MediaDecoder shutdown takes care of
clearing the secondary video container in the MediaDecoder stack, so this is not
actually necessary anymore.

Differential Revision: https://phabricator.services.mozilla.com/D53832
This commit is contained in:
Andreas Pehrson
2019-11-21 12:40:11 +00:00
parent cc6de88315
commit dd3fef9d9d

View File

@@ -101,9 +101,6 @@ NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(HTMLVideoElement,
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLVideoElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(HTMLVideoElement)
if (tmp->mVisualCloneTarget) {
tmp->EndCloningVisually();
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mVisualCloneTarget)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mVisualCloneTargetPromise)
if (tmp->mSecondaryVideoOutput) {