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.

This commit is contained in:
tbogard%aol.net 2000-02-08 20:20:33 +00:00
Родитель 1b2e88bca7
Коммит 799800b4dd
1 изменённых файлов: 4 добавлений и 3 удалений

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

@ -767,9 +767,10 @@ NS_IMETHODIMP nsXULWindow::ShowModal()
appShell->Create(0, nsnull);
appShell->Spinup();
nsCOMPtr<nsIWidget> window = mWindow; // Store locally so it doesn't die on
// us
// Store locally so it doesn't die on us
nsCOMPtr<nsIWidget> window = mWindow;
nsCOMPtr<nsIXULWindow> tempRef = this;
window->SetModal(PR_TRUE);
mContinueModalLoop = PR_TRUE;