зеркало из https://github.com/mozilla/pjs.git
Assert that we destroy ElementAnimations/ElementTransitions through its Destroy() method. (Bug 653644) r=bzbarsky
This commit is contained in:
Родитель
c006ffe6b9
Коммит
71e753bdeb
|
@ -148,12 +148,17 @@ struct CommonElementAnimationData : public PRCList
|
|||
: mElement(aElement)
|
||||
, mElementProperty(aElementProperty)
|
||||
, mManager(aManager)
|
||||
#ifdef DEBUG
|
||||
, mCalledPropertyDtor(false)
|
||||
#endif
|
||||
{
|
||||
MOZ_COUNT_CTOR(CommonElementAnimationData);
|
||||
PR_INIT_CLIST(this);
|
||||
}
|
||||
~CommonElementAnimationData()
|
||||
{
|
||||
NS_ABORT_IF_FALSE(mCalledPropertyDtor,
|
||||
"must call destructor through element property dtor");
|
||||
MOZ_COUNT_DTOR(CommonElementAnimationData);
|
||||
PR_REMOVE_LINK(this);
|
||||
mManager->ElementDataRemoved();
|
||||
|
@ -172,6 +177,10 @@ struct CommonElementAnimationData : public PRCList
|
|||
nsIAtom *mElementProperty;
|
||||
|
||||
CommonAnimationManager *mManager;
|
||||
|
||||
#ifdef DEBUG
|
||||
bool mCalledPropertyDtor;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -159,6 +159,10 @@ ElementAnimationsPropertyDtor(void *aObject,
|
|||
void *aData)
|
||||
{
|
||||
ElementAnimations *ea = static_cast<ElementAnimations*>(aPropertyValue);
|
||||
#ifdef DEBUG
|
||||
NS_ABORT_IF_FALSE(!ea->mCalledPropertyDtor, "can't call dtor twice");
|
||||
ea->mCalledPropertyDtor = true;
|
||||
#endif
|
||||
delete ea;
|
||||
}
|
||||
|
||||
|
|
|
@ -170,6 +170,10 @@ ElementTransitionsPropertyDtor(void *aObject,
|
|||
void *aData)
|
||||
{
|
||||
ElementTransitions *et = static_cast<ElementTransitions*>(aPropertyValue);
|
||||
#ifdef DEBUG
|
||||
NS_ABORT_IF_FALSE(!et->mCalledPropertyDtor, "can't call dtor twice");
|
||||
et->mCalledPropertyDtor = true;
|
||||
#endif
|
||||
delete et;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче