Attempting to wallpaper over the topcrash reported in bug 408116. r+sr=jst@mozilla.com
authorBlake Kaplan <mrbkap@gmail.com>
Fri, 23 Oct 2009 14:50:40 -0700
changeset 32732 38c617c0b2919cf130553545d5a59031f80c0f23
parent 32731 c37fe45bfce822ed2e4ea141f8ba1b7793aee4db
child 32733 437d2de195003d145ab36be9975c3bf8cb5cbaaf
push id566
push usermrbkap@mozilla.com
push dateWed, 04 Nov 2009 16:51:55 +0000
bugs408116
milestone1.9.2b2pre
Attempting to wallpaper over the topcrash reported in bug 408116. r+sr=jst@mozilla.com
content/base/src/nsScriptLoader.cpp
parser/htmlparser/src/nsParser.cpp
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -256,16 +256,20 @@ nsScriptLoader::StartLoad(nsScriptLoadRe
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsILoadGroup> loadGroup = mDocument->GetDocumentLoadGroup();
   nsCOMPtr<nsIStreamLoader> loader;
 
   nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(mDocument->GetScriptGlobalObject()));
+  if (!window) {
+    return NS_ERROR_NULL_POINTER;
+  }
+
   nsIDocShell *docshell = window->GetDocShell();
 
   nsCOMPtr<nsIInterfaceRequestor> prompter(do_QueryInterface(docshell));
 
   nsCOMPtr<nsIChannel> channel;
   rv = NS_NewChannel(getter_AddRefs(channel),
                      aRequest->mURI, nsnull, loadGroup,
                      prompter, nsIRequest::LOAD_NORMAL);
--- a/parser/htmlparser/src/nsParser.cpp
+++ b/parser/htmlparser/src/nsParser.cpp
@@ -1617,16 +1617,21 @@ nsParser::DidBuildModel(nsresult anError
         // DTD was to NS_ENSURE_SUCCESS the sink DidBuildModel call, so if the
         // sink returns failure we should use sinkResult instead of dtdResult,
         // to preserve the old error handling behavior of the DTD:
         result = NS_FAILED(sinkResult) ? sinkResult : dtdResult;
       }
 
       //Ref. to bug 61462.
       mParserContext->mRequest = 0;
+
+      if (mSpeculativeScriptThread) {
+        mSpeculativeScriptThread->Terminate();
+        mSpeculativeScriptThread = nsnull;
+      }
     }
   }
 
   return result;
 }
 
 void
 nsParser::SpeculativelyParse()