Moving release of nsWindow object up from its Destroy method to its caller, nsMacEventHandler. This is a better remainder of a fix for bug 3676. r:saari a:chofmann.

This commit is contained in:
danm%netscape.com 1999-03-15 23:40:42 +00:00
Родитель ec3c5c1c84
Коммит 193d889c56
2 изменённых файлов: 6 добавлений и 13 удалений

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

@ -389,6 +389,12 @@ PRBool nsMacEventHandler::HandleMouseDownEvent(
case inGoAway:
{
mTopLevelWidget->Destroy();
/* terrible hack alert: this Release matches the Addref that was done when the
window widget was created by the nsWebShellWindow. It'd be a lot cleaner to
ask the webshellwindow to release its window, but I feel even worse about
getting to the nsWebShellWindow from the nsWindow, so here goes:
*/
NS_RELEASE(mTopLevelWidget);
break;
}

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

@ -203,19 +203,6 @@ NS_IMETHODIMP nsWindow::Destroy()
ReportDestroyEvent(); // beard: this seems to cause the window to be deleted. moved all release code to destructor.
/* following is a terrible hack. what the heck is the relationship between the webshell window
and this nsWindow? To make a new window, you make one of the former, which makes one
of the latter. To delete a window, you come to this method. What the!!??? Here we are
doing something really awful because it allows you to actually close (or appear to close)
a window on the Mac, whose OS doesn't kill the window for you.
*/
/* Unfortunately this hack has the nasty side effect of causing a crash when trying
to load a new URL in either appRunner or viewer. Feeling that it is better to have
windows that you can't close rather than to crash trying to browse I'm commenting
out the Release() for now.
*/
//Release(); // the ref added when nsWebShellWindow made us
return NS_OK;
}