Bug #16115 --> addref the web shell window inside it's Close method to keep the web shell window from getting

deleted out from under us. This could happen because in closing the window, we are destroying a webshell which
could have the last outstanding reference to the webshell window.
r=dp
This commit is contained in:
mscott%netscape.com 1999-10-13 02:47:56 +00:00
Родитель e0b853e58c
Коммит ee28759d13
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -433,6 +433,13 @@ nsresult nsWebShellWindow::Initialize(nsIWebShellWindow* aParent,
NS_METHOD
nsWebShellWindow::Close()
{
// let's make sure the window doesn't get deleted out from under us
// while we are trying to close....this can happen if the webshell
// we close ends up being the last owning reference to this webshell
// window.
nsCOMPtr<nsIWebShellWindow> placeHolder = this;
ExitModalLoop();
if (mWebShell) {
mWebShell->Destroy();