From 65a4685f648f1dab1375dbc9589bac23d73762a6 Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Mon, 15 May 2000 13:12:27 +0000 Subject: [PATCH] Fix AtomImpl leaks (includes bug 32608). r=pollmann@netscape.com git-svn-id: svn://10.0.0.236/trunk@69785 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsComboboxControlFrame.cpp | 2 +- mozilla/layout/generic/nsFrameFrame.cpp | 1 + mozilla/layout/html/document/src/nsFrameFrame.cpp | 1 + mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index ca2aac037fa..d8dbdb2cf9b 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -511,7 +511,7 @@ nsComboboxControlFrame::ShowPopup(PRBool aShowPopup) // 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. - nsCOMPtr activeAtom ( dont_QueryInterface(NS_NewAtom(kMozDropdownActive))); + nsCOMPtr activeAtom ( dont_AddRef(NS_NewAtom(kMozDropdownActive))); if (PR_TRUE == aShowPopup) { mContent->SetAttribute(kNameSpaceID_None, activeAtom, nsAutoString(), PR_TRUE); } else { diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 3a2de3c95e5..657537ea064 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -751,6 +751,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext, value.Mid(valuePiece, 7, 1) == 1 && valuePiece.EqualsWithConversion("-"))) isContent = PR_TRUE; } + NS_IF_RELEASE(typeAtom); if (isContent) { // The web shell's type is content. docShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent); diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 3a2de3c95e5..657537ea064 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -751,6 +751,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext, value.Mid(valuePiece, 7, 1) == 1 && valuePiece.EqualsWithConversion("-"))) isContent = PR_TRUE; } + NS_IF_RELEASE(typeAtom); if (isContent) { // The web shell's type is content. docShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent); diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index ca2aac037fa..d8dbdb2cf9b 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -511,7 +511,7 @@ nsComboboxControlFrame::ShowPopup(PRBool aShowPopup) // 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. - nsCOMPtr activeAtom ( dont_QueryInterface(NS_NewAtom(kMozDropdownActive))); + nsCOMPtr activeAtom ( dont_AddRef(NS_NewAtom(kMozDropdownActive))); if (PR_TRUE == aShowPopup) { mContent->SetAttribute(kNameSpaceID_None, activeAtom, nsAutoString(), PR_TRUE); } else {