diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index ca2aac037fac..d8dbdb2cf9b2 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/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/layout/generic/nsFrameFrame.cpp b/layout/generic/nsFrameFrame.cpp index 3a2de3c95e5b..657537ea064c 100644 --- a/layout/generic/nsFrameFrame.cpp +++ b/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/layout/html/document/src/nsFrameFrame.cpp b/layout/html/document/src/nsFrameFrame.cpp index 3a2de3c95e5b..657537ea064c 100644 --- a/layout/html/document/src/nsFrameFrame.cpp +++ b/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/layout/html/forms/src/nsComboboxControlFrame.cpp b/layout/html/forms/src/nsComboboxControlFrame.cpp index ca2aac037fac..d8dbdb2cf9b2 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/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 {