Fix for bug 24306. The DocumentViewer now cleans up dangling webshell references in the PresContext. nsGenericElement::TriggerLink deals with a nonexistent handler (it might have been deleted already as part of event processing). r=buster, joki

git-svn-id: svn://10.0.0.236/trunk@59566 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
vidur%netscape.com
2000-02-02 23:40:22 +00:00
parent a128731cb0
commit 09a857de06
5 changed files with 19 additions and 6 deletions

View File

@@ -325,6 +325,11 @@ DocumentViewerImpl::~DocumentViewerImpl()
mDocument->SetScriptGlobalObject(nsnull);
}
if (mPresContext) {
mPresContext->SetContainer(nsnull);
mPresContext->SetLinkHandler(nsnull);
}
if (mDeviceContext)
mDeviceContext->FlushFontCache();

View File

@@ -1275,9 +1275,8 @@ nsGenericElement::TriggerLink(nsIPresContext* aPresContext,
{
nsCOMPtr<nsILinkHandler> handler;
nsresult rv = aPresContext->GetLinkHandler(getter_AddRefs(handler));
if (NS_FAILED(rv)) return rv;
if (!handler) return NS_ERROR_UNEXPECTED; // this can happen in editor windows
if (NS_FAILED(rv) || (nsnull == handler)) return rv;
// Resolve url to an absolute url
nsAutoString absURLSpec;
if (nsnull != aBaseURL) {

View File

@@ -325,6 +325,11 @@ DocumentViewerImpl::~DocumentViewerImpl()
mDocument->SetScriptGlobalObject(nsnull);
}
if (mPresContext) {
mPresContext->SetContainer(nsnull);
mPresContext->SetLinkHandler(nsnull);
}
if (mDeviceContext)
mDeviceContext->FlushFontCache();

View File

@@ -325,6 +325,11 @@ DocumentViewerImpl::~DocumentViewerImpl()
mDocument->SetScriptGlobalObject(nsnull);
}
if (mPresContext) {
mPresContext->SetContainer(nsnull);
mPresContext->SetLinkHandler(nsnull);
}
if (mDeviceContext)
mDeviceContext->FlushFontCache();

View File

@@ -1275,9 +1275,8 @@ nsGenericElement::TriggerLink(nsIPresContext* aPresContext,
{
nsCOMPtr<nsILinkHandler> handler;
nsresult rv = aPresContext->GetLinkHandler(getter_AddRefs(handler));
if (NS_FAILED(rv)) return rv;
if (!handler) return NS_ERROR_UNEXPECTED; // this can happen in editor windows
if (NS_FAILED(rv) || (nsnull == handler)) return rv;
// Resolve url to an absolute url
nsAutoString absURLSpec;
if (nsnull != aBaseURL) {