From 799800b4ddb2053cf745622e990c6468b6b6fefe Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Tue, 8 Feb 2000 20:20:33 +0000 Subject: [PATCH] The XULWindow object can get destroyed during the closing of a window, thus our loop would not have access to the mContinueLoop. We internally bump the ref on ourselves to ensure that while in the loop the object stays valid. r=mscott. --- xpfe/appshell/src/nsXULWindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index 1ef2864cb3a..49f72ed411b 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -767,9 +767,10 @@ NS_IMETHODIMP nsXULWindow::ShowModal() appShell->Create(0, nsnull); appShell->Spinup(); - - nsCOMPtr window = mWindow; // Store locally so it doesn't die on - // us + // Store locally so it doesn't die on us + nsCOMPtr window = mWindow; + nsCOMPtr tempRef = this; + window->SetModal(PR_TRUE); mContinueModalLoop = PR_TRUE;