Bug 899881 - Don't allow frames to have a null style context. r=dbaron

This commit is contained in:
Cameron McCormack 2013-08-03 14:11:05 +10:00
parent f304825fbc
commit 7389a04520
2 changed files with 6 additions and 13 deletions

View File

@ -394,8 +394,7 @@ nsFrame::~nsFrame()
MOZ_COUNT_DTOR(nsFrame);
NS_IF_RELEASE(mContent);
if (mStyleContext)
mStyleContext->Release();
mStyleContext->Release();
}
NS_IMPL_FRAMEARENA_HELPERS(nsFrame)

View File

@ -751,12 +751,9 @@ public:
if (aContext != mStyleContext) {
nsStyleContext* oldStyleContext = mStyleContext;
mStyleContext = aContext;
if (aContext) {
aContext->AddRef();
DidSetStyleContext(oldStyleContext);
}
if (oldStyleContext)
oldStyleContext->Release();
aContext->AddRef();
DidSetStyleContext(oldStyleContext);
oldStyleContext->Release();
}
}
@ -769,12 +766,9 @@ public:
void SetStyleContextWithoutNotification(nsStyleContext* aContext)
{
if (aContext != mStyleContext) {
if (mStyleContext)
mStyleContext->Release();
mStyleContext->Release();
mStyleContext = aContext;
if (aContext) {
aContext->AddRef();
}
aContext->AddRef();
}
}