Fixed a memory leak of a content object

This commit is contained in:
troy%netscape.com 1998-11-11 06:37:30 +00:00
Родитель 5c3b880066
Коммит e248cb0b50
6 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -881,7 +881,7 @@ static void ContentEnumFunc(nsICSSStyleRule* aRule, void* aData)
content->GetParent(content); content->GetParent(content);
NS_IF_RELEASE(lastContent); NS_IF_RELEASE(lastContent);
} }
NS_IF_RELEASE(lastContent); NS_IF_RELEASE(content);
if (nsnull == selector) { // ran out, it matched if (nsnull == selector) { // ran out, it matched
nsIStyleRule* iRule; nsIStyleRule* iRule;
if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) { if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) {

Просмотреть файл

@ -1391,8 +1391,8 @@ PRBool
HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay) HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay)
{ {
// For the time being it's scrollable if the overflow property is auto or // 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 // scroll, regardless of whether the width or height is fixed in size
PRInt32 scrolling = -1; PRInt32 scrolling = -1;
nsISupports* container; nsISupports* container;
if (nsnull != aPresContext) { if (nsnull != aPresContext) {
aPresContext->GetContainer(&container); aPresContext->GetContainer(&container);

Просмотреть файл

@ -881,7 +881,7 @@ static void ContentEnumFunc(nsICSSStyleRule* aRule, void* aData)
content->GetParent(content); content->GetParent(content);
NS_IF_RELEASE(lastContent); NS_IF_RELEASE(lastContent);
} }
NS_IF_RELEASE(lastContent); NS_IF_RELEASE(content);
if (nsnull == selector) { // ran out, it matched if (nsnull == selector) { // ran out, it matched
nsIStyleRule* iRule; nsIStyleRule* iRule;
if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) { if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) {

Просмотреть файл

@ -1391,8 +1391,8 @@ PRBool
HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay) HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay)
{ {
// For the time being it's scrollable if the overflow property is auto or // 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 // scroll, regardless of whether the width or height is fixed in size
PRInt32 scrolling = -1; PRInt32 scrolling = -1;
nsISupports* container; nsISupports* container;
if (nsnull != aPresContext) { if (nsnull != aPresContext) {
aPresContext->GetContainer(&container); aPresContext->GetContainer(&container);

Просмотреть файл

@ -881,7 +881,7 @@ static void ContentEnumFunc(nsICSSStyleRule* aRule, void* aData)
content->GetParent(content); content->GetParent(content);
NS_IF_RELEASE(lastContent); NS_IF_RELEASE(lastContent);
} }
NS_IF_RELEASE(lastContent); NS_IF_RELEASE(content);
if (nsnull == selector) { // ran out, it matched if (nsnull == selector) { // ran out, it matched
nsIStyleRule* iRule; nsIStyleRule* iRule;
if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) { if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) {

Просмотреть файл

@ -1391,8 +1391,8 @@ PRBool
HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay) HTMLStyleSheetImpl::IsScrollable(nsIPresContext* aPresContext, const nsStyleDisplay* aDisplay)
{ {
// For the time being it's scrollable if the overflow property is auto or // 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 // scroll, regardless of whether the width or height is fixed in size
PRInt32 scrolling = -1; PRInt32 scrolling = -1;
nsISupports* container; nsISupports* container;
if (nsnull != aPresContext) { if (nsnull != aPresContext) {
aPresContext->GetContainer(&container); aPresContext->GetContainer(&container);