зеркало из https://github.com/mozilla/gecko-dev.git
Fix leaks. r=dbaron, sr=hewitt
This commit is contained in:
Родитель
9565961ff0
Коммит
ffc678b509
|
@ -407,16 +407,29 @@ nsRuleNode::nsRuleNode(nsIPresContext* aContext, nsIStyleRule* aRule, nsRuleNode
|
|||
mRootChildren = nsnull;
|
||||
}
|
||||
|
||||
PR_STATIC_CALLBACK(PRBool) DeleteRuleNodeChildren(nsHashKey* aKey, void* aData, void* aClosure)
|
||||
{
|
||||
nsRuleNode* ruleNode = (nsRuleNode*)aData;
|
||||
ruleNode->Destroy();
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
nsRuleNode::~nsRuleNode()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsRuleNode);
|
||||
if (mStyleData.mResetData || mStyleData.mInheritedData)
|
||||
mStyleData.Destroy(0, mPresContext);
|
||||
if (mParent && mChildren)
|
||||
if (mParent) {
|
||||
if (mChildren)
|
||||
mChildren->Destroy(mPresContext);
|
||||
else if (!mParent)
|
||||
}
|
||||
else {
|
||||
if (mRootChildren) {
|
||||
mRootChildren->Enumerate(DeleteRuleNodeChildren, nsnull);
|
||||
delete mRootChildren;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsRuleNode::GetBits(PRInt32 aType, PRUint32* aResult)
|
||||
|
|
Загрузка…
Ссылка в новой задаче