From e248cb0b50847d0be4be62d99e9ccacb06a7666f Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 11 Nov 1998 06:37:30 +0000 Subject: [PATCH] Fixed a memory leak of a content object --- content/html/style/src/nsCSSStyleSheet.cpp | 2 +- content/html/style/src/nsHTMLStyleSheet.cpp | 4 ++-- layout/html/style/src/nsCSSStyleSheet.cpp | 2 +- layout/html/style/src/nsHTMLStyleSheet.cpp | 4 ++-- layout/style/nsCSSStyleSheet.cpp | 2 +- layout/style/nsHTMLStyleSheet.cpp | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/content/html/style/src/nsCSSStyleSheet.cpp b/content/html/style/src/nsCSSStyleSheet.cpp index e2474f3d3af..ed26e26bb05 100644 --- a/content/html/style/src/nsCSSStyleSheet.cpp +++ b/content/html/style/src/nsCSSStyleSheet.cpp @@ -881,7 +881,7 @@ static void ContentEnumFunc(nsICSSStyleRule* aRule, void* aData) content->GetParent(content); NS_IF_RELEASE(lastContent); } - NS_IF_RELEASE(lastContent); + NS_IF_RELEASE(content); if (nsnull == selector) { // ran out, it matched nsIStyleRule* iRule; if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) { diff --git a/content/html/style/src/nsHTMLStyleSheet.cpp b/content/html/style/src/nsHTMLStyleSheet.cpp index c3158cf8cac..4d8cd8f063a 100644 --- a/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/content/html/style/src/nsHTMLStyleSheet.cpp @@ -1391,8 +1391,8 @@ PRBool HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay) { // For the time being it's scrollable if the overflow property is auto or - // scroll, regardless of whether the width or height is fixed in size - PRInt32 scrolling = -1; + // scroll, regardless of whether the width or height is fixed in size + PRInt32 scrolling = -1; nsISupports* container; if (nsnull != aPresContext) { aPresContext->GetContainer(&container); diff --git a/layout/html/style/src/nsCSSStyleSheet.cpp b/layout/html/style/src/nsCSSStyleSheet.cpp index e2474f3d3af..ed26e26bb05 100644 --- a/layout/html/style/src/nsCSSStyleSheet.cpp +++ b/layout/html/style/src/nsCSSStyleSheet.cpp @@ -881,7 +881,7 @@ static void ContentEnumFunc(nsICSSStyleRule* aRule, void* aData) content->GetParent(content); NS_IF_RELEASE(lastContent); } - NS_IF_RELEASE(lastContent); + NS_IF_RELEASE(content); if (nsnull == selector) { // ran out, it matched nsIStyleRule* iRule; if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) { diff --git a/layout/html/style/src/nsHTMLStyleSheet.cpp b/layout/html/style/src/nsHTMLStyleSheet.cpp index c3158cf8cac..4d8cd8f063a 100644 --- a/layout/html/style/src/nsHTMLStyleSheet.cpp +++ b/layout/html/style/src/nsHTMLStyleSheet.cpp @@ -1391,8 +1391,8 @@ PRBool HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay) { // For the time being it's scrollable if the overflow property is auto or - // scroll, regardless of whether the width or height is fixed in size - PRInt32 scrolling = -1; + // scroll, regardless of whether the width or height is fixed in size + PRInt32 scrolling = -1; nsISupports* container; if (nsnull != aPresContext) { aPresContext->GetContainer(&container); diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp index e2474f3d3af..ed26e26bb05 100644 --- a/layout/style/nsCSSStyleSheet.cpp +++ b/layout/style/nsCSSStyleSheet.cpp @@ -881,7 +881,7 @@ static void ContentEnumFunc(nsICSSStyleRule* aRule, void* aData) content->GetParent(content); NS_IF_RELEASE(lastContent); } - NS_IF_RELEASE(lastContent); + NS_IF_RELEASE(content); if (nsnull == selector) { // ran out, it matched nsIStyleRule* iRule; if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) { diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp index c3158cf8cac..4d8cd8f063a 100644 --- a/layout/style/nsHTMLStyleSheet.cpp +++ b/layout/style/nsHTMLStyleSheet.cpp @@ -1391,8 +1391,8 @@ PRBool HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay) { // For the time being it's scrollable if the overflow property is auto or - // scroll, regardless of whether the width or height is fixed in size - PRInt32 scrolling = -1; + // scroll, regardless of whether the width or height is fixed in size + PRInt32 scrolling = -1; nsISupports* container; if (nsnull != aPresContext) { aPresContext->GetContainer(&container);