diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 11065c72e1aa..b5844730987f 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -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) diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index fd62e42074d4..4ba4934fa629 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -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(); } }