Fully implement nsDocShell::Destroy() so that webShell can rely on it for it's implementation.

This commit is contained in:
tbogard@aol.net
2000-03-31 00:15:17 +00:00
parent 301d372369
commit 3a63a24a84

View File

@@ -1232,12 +1232,30 @@ NS_IMETHODIMP nsDocShell::Create()
NS_IMETHODIMP nsDocShell::Destroy()
{
// Stop any URLs that are currently being loaded...
Stop();
if(mDocLoader)
{
mDocLoader->Destroy();
mDocLoader->SetContainer(nsnull);
}
SetDocLoaderObserver(nsnull);
// Remove this docshell from its parent's child list
nsCOMPtr<nsIDocShellTreeNode> docShellParentAsNode(do_QueryInterface(mParent));
if(docShellParentAsNode)
docShellParentAsNode->RemoveChild(this);
DestroyChildren();
mContentViewer = nsnull;
mDocLoader = nsnull;
mDocLoaderObserver = nsnull;
mParentWidget = nsnull;
mPrefs = nsnull;
mCurrentURI = nsnull;
mWebProgressListenerList = nsnull;
if(mScriptGlobal)
{
@@ -1254,7 +1272,7 @@ NS_IMETHODIMP nsDocShell::Destroy()
mScriptContext = nsnull;
mSessionHistory = nsnull;
mLoadCookie = nsnull;
mTreeOwner = nsnull;
SetTreeOwner(nsnull);
if(mInitInfo)
{
@@ -1268,7 +1286,6 @@ NS_IMETHODIMP nsDocShell::Destroy()
NS_RELEASE(mContentListener);
}
return NS_OK;
}