Bug 502869 - Crash [@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster]. r=bnewman

This commit is contained in:
Henri Sivonen
2009-08-18 10:48:59 +03:00
parent 5e13603e43
commit 3d71c66683
2 changed files with 4 additions and 3 deletions

View File

@@ -497,9 +497,10 @@ nsHtml5Parser::ParseFragment(const nsAString& aSourceBuffer,
}
}
}
mLifeCycle = TERMINATED;
mTokenizer->eof();
mTokenizer->end();
mLifeCycle = TERMINATED;
mTreeBuilder->Flush();
DropParserAndPerfHint();
return NS_OK;
}
@@ -765,9 +766,10 @@ NS_IMETHODIMP
nsHtml5Parser::DidBuildModel()
{
NS_ASSERTION(mLifeCycle == STREAM_ENDING, "Bad life cycle.");
mLifeCycle = TERMINATED;
mTokenizer->eof();
mTokenizer->end();
mLifeCycle = TERMINATED;
mTreeBuilder->Flush();
// This is comes from nsXMLContentSink
DidBuildModelImpl();
mDocument->ScriptLoader()->RemoveObserver(this);