Bug 881822 - Don't double-refcount HTMLBodyElement::mContentStyleRule; r=bholley

This commit is contained in:
Ms2ger 2013-06-12 09:00:09 +02:00
Родитель e0918cb8dc
Коммит 89bd855192
1 изменённых файлов: 2 добавлений и 5 удалений

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

@ -30,8 +30,8 @@ namespace dom {
//----------------------------------------------------------------------
BodyRule::BodyRule(HTMLBodyElement* aPart)
: mPart(aPart)
{
mPart = aPart;
}
BodyRule::~BodyRule()
@ -349,9 +349,7 @@ HTMLBodyElement::UnbindFromTree(bool aDeep, bool aNullParent)
{
if (mContentStyleRule) {
mContentStyleRule->mPart = nullptr;
// destroy old style rule
NS_RELEASE(mContentStyleRule);
mContentStyleRule = nullptr;
}
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
@ -420,7 +418,6 @@ HTMLBodyElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
// XXXbz should this use OwnerDoc() or GetCurrentDoc()?
// sXBL/XBL2 issue!
mContentStyleRule = new BodyRule(this);
NS_IF_ADDREF(mContentStyleRule);
}
if (aRuleWalker && mContentStyleRule) {
aRuleWalker->Forward(mContentStyleRule);