make GetParent return null if the window has been destroyed. this prevents mistaken attempts to access a destroyed window's parent. bug 92291 r=hyatt,saari

This commit is contained in:
danm%netscape.com 2001-08-02 00:19:24 +00:00
Родитель ad8345e05c
Коммит 7fc84a6001
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -1270,6 +1270,11 @@ nsIWidget* nsWindow::GetParent(void)
// a HWND which is not associated with a nsIWidget.
return nsnull;
}
/* If this widget has already been destroyed, pretend we have no parent.
This corresponds to code in Destroy which removes the destroyed
widget from its parent's child list. */
if (mIsDestroying || mOnDestroyCalled)
return nsnull;
nsWindow* widget = nsnull;