Permalink
Browse files

Bug 336978, Crash when window gets destroyed on pagehide event, r+sr=…

…bryner
  • Loading branch information...
Olli.Pettay%helsinki.fi Olli.Pettay%helsinki.fi
Olli.Pettay%helsinki.fi authored and Olli.Pettay%helsinki.fi committed May 24, 2006
1 parent 1072616 commit 68d82c8fad255796d7073253813178e20bb8aabc
Showing with 6 additions and 0 deletions.
  1. +3 −0 docshell/base/nsDocShell.cpp
  2. +3 −0 layout/base/nsDocumentViewer.cpp
@@ -921,6 +921,9 @@ NS_IMETHODIMP
nsDocShell::FirePageHideNotification(PRBool aIsUnload)
{
if (mContentViewer && !mFiredUnloadEvent) {
// Keep an explicit reference since calling PageHide could release
// mContentViewer
nsCOMPtr<nsIContentViewer> kungFuDeathGrip(mContentViewer);
mFiredUnloadEvent = PR_TRUE;
mContentViewer->PageHide(aIsUnload);
@@ -1240,6 +1240,9 @@ DocumentViewerImpl::PageHide(PRBool aIsUnload)
if (!aIsUnload)
return NS_OK;
// if Destroy() was called during OnPageHide(), mDocument is nsnull.
NS_ENSURE_STATE(mDocument);
// First, get the window from the document...
nsPIDOMWindow *window = mDocument->GetWindow();

0 comments on commit 68d82c8

Please sign in to comment.