Bug 472260 - Crash [@ nsDocShell::EnsureContentViewer], r+sr=bz

This commit is contained in:
Olli Pettay
2009-01-09 10:45:14 +02:00
parent aee7bd6a82
commit 4dba4d4a8a
2 changed files with 7 additions and 4 deletions

View File

@@ -215,8 +215,11 @@ nsFrameLoader::ReallyStartLoading()
loadInfo->SetReferrer(referrer);
// Kick off the load...
PRBool tmpState = mNeedsAsyncDestroy;
mNeedsAsyncDestroy = PR_TRUE;
rv = mDocShell->LoadURI(mURIToLoad, loadInfo,
nsIWebNavigation::LOAD_FLAGS_NONE, PR_FALSE);
mNeedsAsyncDestroy = tmpState;
mURIToLoad = nsnull;
#ifdef DEBUG
if (NS_FAILED(rv)) {
@@ -747,7 +750,7 @@ nsFrameLoader::Destroy()
win_private->SetFrameElementInternal(nsnull);
}
if ((mInDestructor || !doc ||
if ((mNeedsAsyncDestroy || !doc ||
NS_FAILED(doc->FinalizeFrameLoader(this))) && mDocShell) {
nsCOMPtr<nsIRunnable> event = new nsAsyncDocShellDestroyer(mDocShell);
NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);