changed conditional NS_RELEASE to NS_IF_RELEASE to fix memory leak

This commit is contained in:
karnaze%netscape.com 1999-08-25 21:57:15 +00:00
parent 4a7f7b54e2
commit 49bded7631

View File

@ -286,7 +286,6 @@ nsScrollFrame::CreateScrollingView(nsIPresContext& aPresContext)
nsIAtom* frameType = nsnull;
parent->GetFrameType(&frameType);
if (nsLayoutAtoms::viewportFrame == frameType) {
NS_RELEASE(frameType);
nsCOMPtr<nsISupports> container;
rv = aPresContext.GetContainer(getter_AddRefs(container));
if (NS_SUCCEEDED(rv) && container) {
@ -305,6 +304,7 @@ nsScrollFrame::CreateScrollingView(nsIPresContext& aPresContext)
}
}
}
NS_IF_RELEASE(frameType);
scrollingView->SetScrollPreference(scrollPref);
// Set the scrolling view's insets to whatever our border is