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:
jst%mozilla.jstenback.com 2004-02-26 02:35:30 +00:00
Родитель a9c494bb07
Коммит 7ce5402510
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -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;