fix antother webshell leak. Add a CleanUp method to the global window. When the global window is told it is closing,

call the CleanUp method to force it to release all of it's state.
r=vidur, a=chofmann
This commit is contained in:
mscott%netscape.com 1999-12-17 00:50:17 +00:00
parent ab9aa71baa
commit 5f4692f308
2 changed files with 11 additions and 2 deletions

View File

@ -181,8 +181,8 @@ GlobalWindowImpl::GlobalWindowImpl()
mWebShell = nsnull; mWebShell = nsnull;
} }
GlobalWindowImpl::~GlobalWindowImpl() void GlobalWindowImpl::CleanUp()
{ {
NS_IF_RELEASE(mContext); NS_IF_RELEASE(mContext);
NS_IF_RELEASE(mDocument); NS_IF_RELEASE(mDocument);
NS_IF_RELEASE(mNavigator); NS_IF_RELEASE(mNavigator);
@ -200,6 +200,11 @@ GlobalWindowImpl::~GlobalWindowImpl()
NS_IF_RELEASE(mListenerManager); NS_IF_RELEASE(mListenerManager);
} }
GlobalWindowImpl::~GlobalWindowImpl()
{
CleanUp();
}
NS_IMPL_ADDREF(GlobalWindowImpl) NS_IMPL_ADDREF(GlobalWindowImpl)
NS_IMPL_RELEASE(GlobalWindowImpl) NS_IMPL_RELEASE(GlobalWindowImpl)
@ -1348,6 +1353,8 @@ GlobalWindowImpl::Close()
mBrowser->Close(); mBrowser->Close();
NS_RELEASE(mBrowser); NS_RELEASE(mBrowser);
} }
CleanUp();
return NS_OK; return NS_OK;
} }

View File

@ -297,6 +297,8 @@ protected:
nsDOMWindowList *mFrames; nsDOMWindowList *mFrames;
PRBool mFirstDocumentLoad; PRBool mFirstDocumentLoad;
void CleanUp();
}; };
/* /*