From fee86da3b9b94b55784e2c71e35d6b40b912f843 Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Sat, 13 Apr 2002 18:54:40 +0000 Subject: [PATCH] Fix leak (within the pres shell arena) of lines from nsLineBox::DeleteLineList. b=136764 r=attinasi sr=waterson git-svn-id: svn://10.0.0.236/trunk@118934 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsLineBox.cpp | 9 ++++++--- mozilla/layout/html/base/src/nsLineBox.cpp | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/generic/nsLineBox.cpp b/mozilla/layout/generic/nsLineBox.cpp index b3dcc9ec703..e7bcdf766ef 100644 --- a/mozilla/layout/generic/nsLineBox.cpp +++ b/mozilla/layout/generic/nsLineBox.cpp @@ -312,11 +312,14 @@ nsLineBox::DeleteLineList(nsIPresContext* aPresContext, nsLineList& aLines) child = nextChild; } - while (! aLines.empty()) { + nsCOMPtr shell; + aPresContext->GetShell(getter_AddRefs(shell)); + + do { nsLineBox* line = aLines.front(); aLines.pop_front(); - delete line; - } + line->Destroy(shell); + } while (! aLines.empty()); } } diff --git a/mozilla/layout/html/base/src/nsLineBox.cpp b/mozilla/layout/html/base/src/nsLineBox.cpp index b3dcc9ec703..e7bcdf766ef 100644 --- a/mozilla/layout/html/base/src/nsLineBox.cpp +++ b/mozilla/layout/html/base/src/nsLineBox.cpp @@ -312,11 +312,14 @@ nsLineBox::DeleteLineList(nsIPresContext* aPresContext, nsLineList& aLines) child = nextChild; } - while (! aLines.empty()) { + nsCOMPtr shell; + aPresContext->GetShell(getter_AddRefs(shell)); + + do { nsLineBox* line = aLines.front(); aLines.pop_front(); - delete line; - } + line->Destroy(shell); + } while (! aLines.empty()); } }