Fixed reference counting bugs with OPTION tag handling

This commit is contained in:
kipp%netscape.com 1998-08-03 19:21:26 +00:00
parent 94ba1901d6
commit f13723d5d8
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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;