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

This commit is contained in:
locka%iol.ie 2000-10-30 23:47:11 +00:00
Родитель 05042507f6
Коммит e2193efb9c
3 изменённых файлов: 9 добавлений и 0 удалений

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

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

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

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

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

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