Bug 1288228 part 2: When a DOMSVGLength is CC'd, remove it from tearoff table and drop its weak ref to wrapped val.

This commit is contained in:
Daniel Holbert
2016-09-21 14:53:35 +02:00
committed by roytam1
parent f0e646a58f
commit 7d3efe6f3d
+2 -4
View File
@@ -32,10 +32,8 @@ static nsSVGAttrTearoffTable<nsSVGLength2, DOMSVGLength>
NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGLength)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGLength)
// We may not belong to a list, so we must null check tmp->mList.
if (tmp->mList) {
tmp->mList->mItems[tmp->mListIndex] = nullptr;
}
tmp->CleanupWeakRefs();
tmp->mVal = nullptr; // (owned by mSVGElement, which we drop our ref to here)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mList)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSVGElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER