Added missing NS_RELEASE of the content object in GetMarginHeight()

git-svn-id: svn://10.0.0.236/trunk@15107 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com 1998-11-21 17:30:41 +00:00
parent d8e49916cf
commit 36cc15c205
2 changed files with 6 additions and 8 deletions

View File

@ -529,8 +529,7 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginWidth(nsIPresContext* aPresContext, nsIC
{
PRInt32 marginWidth = -1;
nsIHTMLContent* content = nsnull;
mContent->QueryInterface(kIHTMLContentIID, (void**) &content);
if (nsnull != content) {
if (NS_SUCCEEDED(mContent->QueryInterface(kIHTMLContentIID, (void**) &content))) {
float p2t;
aPresContext->GetScaledPixelsToTwips(p2t);
nsHTMLValue value;
@ -550,8 +549,7 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginHeight(nsIPresContext* aPresContext, nsI
{
PRInt32 marginHeight = -1;
nsIHTMLContent* content = nsnull;
mContent->QueryInterface(kIHTMLContentIID, (void**) &content);
if (nsnull != content) {
if (NS_SUCCEEDED(mContent->QueryInterface(kIHTMLContentIID, (void**) &content))) {
float p2t;
aPresContext->GetScaledPixelsToTwips(p2t);
nsHTMLValue value;
@ -562,6 +560,7 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginHeight(nsIPresContext* aPresContext, nsI
marginHeight = 0;
}
}
NS_RELEASE(content);
}
return marginHeight;
}

View File

@ -529,8 +529,7 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginWidth(nsIPresContext* aPresContext, nsIC
{
PRInt32 marginWidth = -1;
nsIHTMLContent* content = nsnull;
mContent->QueryInterface(kIHTMLContentIID, (void**) &content);
if (nsnull != content) {
if (NS_SUCCEEDED(mContent->QueryInterface(kIHTMLContentIID, (void**) &content))) {
float p2t;
aPresContext->GetScaledPixelsToTwips(p2t);
nsHTMLValue value;
@ -550,8 +549,7 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginHeight(nsIPresContext* aPresContext, nsI
{
PRInt32 marginHeight = -1;
nsIHTMLContent* content = nsnull;
mContent->QueryInterface(kIHTMLContentIID, (void**) &content);
if (nsnull != content) {
if (NS_SUCCEEDED(mContent->QueryInterface(kIHTMLContentIID, (void**) &content))) {
float p2t;
aPresContext->GetScaledPixelsToTwips(p2t);
nsHTMLValue value;
@ -562,6 +560,7 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginHeight(nsIPresContext* aPresContext, nsI
marginHeight = 0;
}
}
NS_RELEASE(content);
}
return marginHeight;
}