From ac6023ebac3deadf813881b0c617adf2a4ba490a Mon Sep 17 00:00:00 2001 From: "mats.palmgren%bredband.net" Date: Sat, 6 Jan 2007 21:02:05 +0000 Subject: [PATCH] Plug a leak of nsDirectionalFrames. b=365909 r+sr=dbaron --- layout/base/nsBidiPresUtils.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp index afe62b8cd7b..e29e648a60d 100644 --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -489,7 +489,8 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext, directionalFrame = nsnull; if (aAddMarkers && - frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) { + frame->IsFrameOfType(nsIFrame::eBidiInlineContainer) && + !frame->GetPrevContinuation()) { const nsStyleVisibility* vis = frame->GetStyleVisibility(); const nsStyleTextReset* text = frame->GetStyleTextReset(); switch (text->mUnicodeBidi) { @@ -519,7 +520,7 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext, // Create a directional frame before the first frame of an // element specifying embedding or override - if (directionalFrame && !frame->GetPrevContinuation()) { + if (directionalFrame) { mLogicalFrames.AppendElement(directionalFrame); } } @@ -542,12 +543,12 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext, } // If the element is attributed by dir, indicate direction pop (add PDF frame) - if (directionalFrame) { + if (directionalFrame && !frame->GetNextContinuation()) { directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kPDF); // Create a directional frame after the last frame of an // element specifying embedding or override - if (directionalFrame && !frame->GetNextContinuation()) { + if (directionalFrame) { mLogicalFrames.AppendElement(directionalFrame); } }