Too many bugs to mention; tables, skipped content; perf; memory
This commit is contained in:
+11
-13
@@ -395,10 +395,8 @@ PRInt32 nsParser::DidBuildModel(PRInt32 anErrorCode) {
|
||||
if(mParserContext->mDTD) {
|
||||
result=mParserContext->mDTD->DidBuildModel(anErrorCode,PRBool(0==mParserContext->mPrevContext));
|
||||
|
||||
//Now it's time to recycle our used tokens.
|
||||
//The current context has a deque full of them,
|
||||
//and the ones that preceed currentpos are no
|
||||
//longer needed. Let's recycle them.
|
||||
//Now recycle any tokens that are still hanging around.
|
||||
//Come to think of it, there really shouldn't be any.
|
||||
nsDeque& theDeque=mParserContext->mTokenDeque;
|
||||
nsITokenRecycler* theRecycler=mParserContext->mDTD->GetTokenRecycler();
|
||||
if(theRecycler) {
|
||||
@@ -588,25 +586,25 @@ PRInt32 nsParser::BuildModel() {
|
||||
theRootDTD->Verify(kEmptyString);
|
||||
}
|
||||
|
||||
if(kInterrupted==result) {
|
||||
*mParserContext->mCurrentPos=theMarkPos;
|
||||
|
||||
//Now it's time to recycle our used tokens.
|
||||
//The current context has a deque full of them,
|
||||
//and the ones that preceed currentpos are no
|
||||
//longer needed. Let's recycle them.
|
||||
nsITokenRecycler* theRecycler=theRootDTD->GetTokenRecycler();
|
||||
if(theRecycler) {
|
||||
nsDeque& theDeque=mParserContext->mTokenDeque;
|
||||
CToken* theCurrentToken=(CToken*)mParserContext->mCurrentPos->GetCurrent();
|
||||
nsITokenRecycler* theRecycler=theRootDTD->GetTokenRecycler();
|
||||
if(theRecycler) {
|
||||
nsDeque& theDeque=mParserContext->mTokenDeque;
|
||||
CToken* theCurrentToken=(CToken*)mParserContext->mCurrentPos->GetCurrent();
|
||||
for(;;) {
|
||||
CToken* theToken=(CToken*)theDeque.Peek();
|
||||
while(theToken && (theToken!=theCurrentToken)) {
|
||||
if(theToken && (theToken!=theCurrentToken)){
|
||||
theDeque.Pop();
|
||||
theRecycler->RecycleToken(theToken);
|
||||
}
|
||||
else break;
|
||||
}
|
||||
mParserContext->mCurrentPos->First();
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user