Fix AtomImpl leaks (includes bug 32608). r=pollmann@netscape.com

This commit is contained in:
dbaron%fas.harvard.edu 2000-05-15 13:12:27 +00:00
parent 15a4c992b7
commit 3de09ce54f
4 changed files with 4 additions and 2 deletions

View File

@ -511,7 +511,7 @@ nsComboboxControlFrame::ShowPopup(PRBool aShowPopup)
// which causes the active state to be removed from the event state manager immediately after it // which causes the active state to be removed from the event state manager immediately after it
// it the select is set to the active state. // it the select is set to the active state.
nsCOMPtr<nsIAtom> activeAtom ( dont_QueryInterface(NS_NewAtom(kMozDropdownActive))); nsCOMPtr<nsIAtom> activeAtom ( dont_AddRef(NS_NewAtom(kMozDropdownActive)));
if (PR_TRUE == aShowPopup) { if (PR_TRUE == aShowPopup) {
mContent->SetAttribute(kNameSpaceID_None, activeAtom, nsAutoString(), PR_TRUE); mContent->SetAttribute(kNameSpaceID_None, activeAtom, nsAutoString(), PR_TRUE);
} else { } else {

View File

@ -751,6 +751,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext,
value.Mid(valuePiece, 7, 1) == 1 && valuePiece.EqualsWithConversion("-"))) value.Mid(valuePiece, 7, 1) == 1 && valuePiece.EqualsWithConversion("-")))
isContent = PR_TRUE; isContent = PR_TRUE;
} }
NS_IF_RELEASE(typeAtom);
if (isContent) { if (isContent) {
// The web shell's type is content. // The web shell's type is content.
docShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent); docShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent);

View File

@ -751,6 +751,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext,
value.Mid(valuePiece, 7, 1) == 1 && valuePiece.EqualsWithConversion("-"))) value.Mid(valuePiece, 7, 1) == 1 && valuePiece.EqualsWithConversion("-")))
isContent = PR_TRUE; isContent = PR_TRUE;
} }
NS_IF_RELEASE(typeAtom);
if (isContent) { if (isContent) {
// The web shell's type is content. // The web shell's type is content.
docShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent); docShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent);

View File

@ -511,7 +511,7 @@ nsComboboxControlFrame::ShowPopup(PRBool aShowPopup)
// which causes the active state to be removed from the event state manager immediately after it // which causes the active state to be removed from the event state manager immediately after it
// it the select is set to the active state. // it the select is set to the active state.
nsCOMPtr<nsIAtom> activeAtom ( dont_QueryInterface(NS_NewAtom(kMozDropdownActive))); nsCOMPtr<nsIAtom> activeAtom ( dont_AddRef(NS_NewAtom(kMozDropdownActive)));
if (PR_TRUE == aShowPopup) { if (PR_TRUE == aShowPopup) {
mContent->SetAttribute(kNameSpaceID_None, activeAtom, nsAutoString(), PR_TRUE); mContent->SetAttribute(kNameSpaceID_None, activeAtom, nsAutoString(), PR_TRUE);
} else { } else {