Bug 770218 - null check mAList during unlink of DOMSVG{Length,Number,Transform}List. r=jwatt

This commit is contained in:
Andrew McCreight 2012-07-18 15:44:22 -07:00
Родитель 3817442ad3
Коммит 86ad8a2340
3 изменённых файлов: 24 добавлений и 10 удалений

Просмотреть файл

@ -41,9 +41,14 @@ namespace mozilla {
// the cycle, as NS_SVG_VAL_IMPL_CYCLE_COLLECTION does.)
NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGLengthList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGLengthList)
// No need to null check tmp - script/SMIL can't detach us from mAList
( tmp->IsAnimValList() ? tmp->mAList->mAnimVal : tmp->mAList->mBaseVal ) = nsnull;
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mAList)
if (tmp->mAList) {
if (tmp->IsAnimValList()) {
tmp->mAList->mAnimVal = nsnull;
} else {
tmp->mAList->mBaseVal = nsnull;
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mAList)
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGLengthList)

Просмотреть файл

@ -41,9 +41,14 @@ void UpdateListIndicesFromIndex(nsTArray<DOMSVGNumber*>& aItemsArray,
// the cycle, as NS_SVG_VAL_IMPL_CYCLE_COLLECTION does.)
NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGNumberList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGNumberList)
// No need to null check tmp - script/SMIL can't detach us from mAList
( tmp->IsAnimValList() ? tmp->mAList->mAnimVal : tmp->mAList->mBaseVal ) = nsnull;
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mAList)
if (tmp->mAList) {
if (tmp->IsAnimValList()) {
tmp->mAList->mAnimVal = nsnull;
} else {
tmp->mAList->mBaseVal = nsnull;
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mAList)
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGNumberList)

Просмотреть файл

@ -37,10 +37,14 @@ namespace mozilla {
// the cycle, as NS_SVG_VAL_IMPL_CYCLE_COLLECTION does.)
NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGTransformList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGTransformList)
// No need to null check tmp - script/SMIL can't detach us from mAList
( tmp->IsAnimValList() ? tmp->mAList->mAnimVal : tmp->mAList->mBaseVal ) =
nsnull;
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mAList)
if (tmp->mAList) {
if (tmp->IsAnimValList()) {
tmp->mAList->mAnimVal = nsnull;
} else {
tmp->mAList->mBaseVal = nsnull;
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mAList)
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGTransformList)