Fully implement nsDocShell::Destroy() so that webShell can rely on it for it's implementation.
This commit is contained in:
@@ -1232,12 +1232,30 @@ NS_IMETHODIMP nsDocShell::Create()
|
|||||||
|
|
||||||
NS_IMETHODIMP nsDocShell::Destroy()
|
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;
|
mContentViewer = nsnull;
|
||||||
mDocLoader = nsnull;
|
mDocLoader = nsnull;
|
||||||
mDocLoaderObserver = nsnull;
|
mDocLoaderObserver = nsnull;
|
||||||
mParentWidget = nsnull;
|
mParentWidget = nsnull;
|
||||||
mPrefs = nsnull;
|
mPrefs = nsnull;
|
||||||
mCurrentURI = nsnull;
|
mCurrentURI = nsnull;
|
||||||
|
mWebProgressListenerList = nsnull;
|
||||||
|
|
||||||
if(mScriptGlobal)
|
if(mScriptGlobal)
|
||||||
{
|
{
|
||||||
@@ -1254,7 +1272,7 @@ NS_IMETHODIMP nsDocShell::Destroy()
|
|||||||
mScriptContext = nsnull;
|
mScriptContext = nsnull;
|
||||||
mSessionHistory = nsnull;
|
mSessionHistory = nsnull;
|
||||||
mLoadCookie = nsnull;
|
mLoadCookie = nsnull;
|
||||||
mTreeOwner = nsnull;
|
SetTreeOwner(nsnull);
|
||||||
|
|
||||||
if(mInitInfo)
|
if(mInitInfo)
|
||||||
{
|
{
|
||||||
@@ -1268,7 +1286,6 @@ NS_IMETHODIMP nsDocShell::Destroy()
|
|||||||
NS_RELEASE(mContentListener);
|
NS_RELEASE(mContentListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user