From 0dc63e6385a24fb2ccab50267a1d05bf4bfa0ab2 Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Wed, 16 Jun 1999 00:27:41 +0000 Subject: [PATCH] just added some usage notes and a bit of extra care during window initialization --- xpfe/appshell/src/nsAppShellService.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index 94eb9294520a..a61b26d91723 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -462,6 +462,7 @@ nsAppShellService::CreateTopLevelWindow(nsIWebShellWindow *aParent, nsresult rv; nsWebShellWindow* window; + aResult = nsnull; window = new nsWebShellWindow(); if (nsnull == window) { rv = NS_ERROR_OUT_OF_MEMORY; @@ -505,6 +506,7 @@ nsAppShellService::CreateDialogWindow(nsIWebShellWindow * aParent, nsresult rv; nsWebShellWindow* window; + aResult = nsnull; window = new nsWebShellWindow(); if (nsnull == window) { rv = NS_ERROR_OUT_OF_MEMORY; @@ -530,7 +532,13 @@ nsAppShellService::CreateDialogWindow(nsIWebShellWindow * aParent, settings or get information out of the dialog before dismissal, use event handlers. This wrapper method is desirable because of the complications creeping in to the modal window story: there's a lot of setup. - See the code. + See the code.. + + Note that the window created is returned in aResult. By the time this function + exits, that window has been partially destroyed. We return it anyway, in the + hopes that it may be queried for results, somehow. This may be a mistake. + It is returned addrefed (by the QueryInterface to nsIWebShellWindow in + CreateDialogWindow). */ NS_IMETHODIMP nsAppShellService::RunModalDialog(