Don't call DidBuildModel twice if Terminate is called twice since consumers aren't expecting it. bug 378982, r+sr=bzbarsky

This commit is contained in:
mrbkap@gmail.com 2007-05-21 11:09:54 -07:00
Родитель 24b27e6665
Коммит e87c4579ff
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1038,6 +1038,12 @@ nsParser::GetRootContextKey()
NS_IMETHODIMP
nsParser::Terminate(void)
{
// We should only call DidBuildModel once, so don't do anything if this is
// the second time that Terminate has been called.
if (mInternalState == NS_ERROR_HTMLPARSER_STOPPARSING) {
return NS_OK;
}
nsresult result = NS_OK;
// XXX - [ until we figure out a way to break parser-sink circularity ]
// Hack - Hold a reference until we are completely done...