Fix for crash when closing main window while print dialog is open (checked in for Frank Tang). b=35896, sr=vidur, r=adamlock

git-svn-id: svn://10.0.0.236/trunk@82071 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie 2000-10-30 23:47:11 +00:00
parent 951fd4d23b
commit 6b15cffdba
3 changed files with 9 additions and 0 deletions

View File

@ -2593,6 +2593,9 @@ NS_IMETHODIMP GlobalWindowImpl::GetPrivateRoot(nsIDOMWindowInternal ** aParent)
nsCOMPtr<nsIScriptGlobalObject> parentTop = do_QueryInterface(parent);
nsCOMPtr<nsIDocShell> docShell;
NS_ASSERTION(parentTop, "cannot get parentTop");
if(parentTop == nsnull)
return NS_ERROR_FAILURE;
parentTop->GetDocShell(getter_AddRefs(docShell));
nsCOMPtr<nsIChromeEventHandler> chromeEventHandler;
docShell->GetChromeEventHandler(getter_AddRefs(chromeEventHandler));

View File

@ -2125,6 +2125,9 @@ static void CheckForFocus(nsIDocument* aDocument)
nsCOMPtr<nsIDOMWindowInternal> rootWindow;
nsCOMPtr<nsPIDOMWindow> ourWindow = do_QueryInterface(globalObject);
ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow));
NS_ASSERTION(rootWindow , "cannot get rootWindow");
if(nsnull == rootWindow)
return;
nsCOMPtr<nsIDOMDocument> rootDocument;
rootWindow->GetDocument(getter_AddRefs(rootDocument));

View File

@ -2125,6 +2125,9 @@ static void CheckForFocus(nsIDocument* aDocument)
nsCOMPtr<nsIDOMWindowInternal> rootWindow;
nsCOMPtr<nsPIDOMWindow> ourWindow = do_QueryInterface(globalObject);
ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow));
NS_ASSERTION(rootWindow , "cannot get rootWindow");
if(nsnull == rootWindow)
return;
nsCOMPtr<nsIDOMDocument> rootDocument;
rootWindow->GetDocument(getter_AddRefs(rootDocument));