From ffe8a3055bc46d82c592aeb5bc32cbed85177d5d Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Fri, 23 Oct 2009 14:50:40 -0700 Subject: [PATCH] Attempting to wallpaper over the topcrash reported in bug 408116. r+sr=jst@mozilla.com --- content/base/src/nsScriptLoader.cpp | 4 ++++ parser/htmlparser/src/nsParser.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index a739d5e944b3..0d60e8f7f0c7 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -261,6 +261,10 @@ nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType) nsCOMPtr loader; nsCOMPtr window(do_QueryInterface(mDocument->GetScriptGlobalObject())); + if (!window) { + return NS_ERROR_NULL_POINTER; + } + nsIDocShell *docshell = window->GetDocShell(); nsCOMPtr prompter(do_QueryInterface(docshell)); diff --git a/parser/htmlparser/src/nsParser.cpp b/parser/htmlparser/src/nsParser.cpp index d95a7f262c0c..ccfe9f2d1fb6 100644 --- a/parser/htmlparser/src/nsParser.cpp +++ b/parser/htmlparser/src/nsParser.cpp @@ -1617,6 +1617,11 @@ nsParser::DidBuildModel(nsresult anErrorCode) //Ref. to bug 61462. mParserContext->mRequest = 0; + + if (mSpeculativeScriptThread) { + mSpeculativeScriptThread->Terminate(); + mSpeculativeScriptThread = nsnull; + } } }