Fixed reference counting bugs with OPTION tag handling
git-svn-id: svn://10.0.0.236/trunk@7127 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
6e825c79fc
commit
d72db37d83
@ -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…
x
Reference in New Issue
Block a user