mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Fixed reference counting bugs with OPTION tag handling
This commit is contained in:
parent
94ba1901d6
commit
f13723d5d8
@ -2064,6 +2064,10 @@ HTMLContentSink::ProcessOpenOPTIONTag(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* atom = NS_NewAtom(tmp);
|
||||
rv = NS_NewHTMLOption(&mCurrentOption, atom);
|
||||
if ((NS_OK == rv) && (nsnull != mCurrentSelect)) {
|
||||
// Add another reference to the option since we remember it both
|
||||
// on our container stack and in mCurrentOption
|
||||
NS_ADDREF(mCurrentOption);
|
||||
|
||||
// Add remaining attributes from the tag
|
||||
//rv = AddAttributes(aNode, mCurrentOption);
|
||||
*aInstancePtrResult = mCurrentOption;
|
||||
@ -2112,6 +2116,7 @@ HTMLContentSink::ProcessOPTIONTagContent(const nsIParserNode& aNode)
|
||||
break;
|
||||
}
|
||||
control->SetContent(currentText);
|
||||
NS_RELEASE(control);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -2064,6 +2064,10 @@ HTMLContentSink::ProcessOpenOPTIONTag(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* atom = NS_NewAtom(tmp);
|
||||
rv = NS_NewHTMLOption(&mCurrentOption, atom);
|
||||
if ((NS_OK == rv) && (nsnull != mCurrentSelect)) {
|
||||
// Add another reference to the option since we remember it both
|
||||
// on our container stack and in mCurrentOption
|
||||
NS_ADDREF(mCurrentOption);
|
||||
|
||||
// Add remaining attributes from the tag
|
||||
//rv = AddAttributes(aNode, mCurrentOption);
|
||||
*aInstancePtrResult = mCurrentOption;
|
||||
@ -2112,6 +2116,7 @@ HTMLContentSink::ProcessOPTIONTagContent(const nsIParserNode& aNode)
|
||||
break;
|
||||
}
|
||||
control->SetContent(currentText);
|
||||
NS_RELEASE(control);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user