Added code to delete nsBrowserWindow object

git-svn-id: svn://10.0.0.236/trunk@7667 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com 1998-08-10 18:20:20 +00:00
parent b4b3615aa5
commit d4bb51be47
2 changed files with 4 additions and 1 deletions

View File

@ -203,6 +203,7 @@ HandleBrowserEvent(nsGUIEvent *aEvent)
case NS_DESTROY:
bw->Destroy();
NS_RELEASE(bw);
return nsEventStatus_eConsumeDoDefault;
case NS_MENU_SELECTED:
@ -471,7 +472,6 @@ nsBrowserWindow::nsBrowserWindow()
nsBrowserWindow::~nsBrowserWindow()
{
Destroy();
}
NS_IMPL_ADDREF(nsBrowserWindow)

View File

@ -350,6 +350,9 @@ NS_IMETHODIMP
nsViewerApp::OpenWindow()
{
// Create browser window
// XXX Some piece of code needs to properly hold the reference to this
// browser window. For the time being the reference is released by the
// browser event handling code during processing of the NS_DESTROY event...
nsBrowserWindow* bw = nsnull;
nsresult rv = NSRepository::CreateInstance(kBrowserWindowCID, nsnull,
kIBrowserWindowIID,