зеркало из https://github.com/mozilla/gecko-dev.git
Fixing regression crasher bug 235209. Make sure we have a strong reference to a nsIScriptContext we're touching *after* we've executed scripts on it. r=danm-moz@comcast.net, sr=bzbarsky@mit.edu
This commit is contained in:
Родитель
2fb7301a66
Коммит
9f2e3f9efb
|
@ -627,7 +627,10 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
|
|||
nsIScriptGlobalObject *globalObject = mDocument->GetScriptGlobalObject();
|
||||
NS_ENSURE_TRUE(globalObject, NS_ERROR_FAILURE);
|
||||
|
||||
nsIScriptContext *context = globalObject->GetContext();
|
||||
// Make sure context is a strong reference since we access it after
|
||||
// we've executed a script, which may cause all other references to
|
||||
// the context to go away.
|
||||
nsCOMPtr<nsIScriptContext> context = globalObject->GetContext();
|
||||
if (!context) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -646,7 +649,7 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
|
|||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
context->SetProcessingScriptTag(PR_TRUE);
|
||||
|
||||
PRBool isUndefined;
|
||||
|
|
Загрузка…
Ссылка в новой задаче