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:
@@ -325,6 +325,11 @@ DocumentViewerImpl::~DocumentViewerImpl()
|
||||
mDocument->SetScriptGlobalObject(nsnull);
|
||||
}
|
||||
|
||||
if (mPresContext) {
|
||||
mPresContext->SetContainer(nsnull);
|
||||
mPresContext->SetLinkHandler(nsnull);
|
||||
}
|
||||
|
||||
if (mDeviceContext)
|
||||
mDeviceContext->FlushFontCache();
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -325,6 +325,11 @@ DocumentViewerImpl::~DocumentViewerImpl()
|
||||
mDocument->SetScriptGlobalObject(nsnull);
|
||||
}
|
||||
|
||||
if (mPresContext) {
|
||||
mPresContext->SetContainer(nsnull);
|
||||
mPresContext->SetLinkHandler(nsnull);
|
||||
}
|
||||
|
||||
if (mDeviceContext)
|
||||
mDeviceContext->FlushFontCache();
|
||||
|
||||
|
||||
@@ -325,6 +325,11 @@ DocumentViewerImpl::~DocumentViewerImpl()
|
||||
mDocument->SetScriptGlobalObject(nsnull);
|
||||
}
|
||||
|
||||
if (mPresContext) {
|
||||
mPresContext->SetContainer(nsnull);
|
||||
mPresContext->SetLinkHandler(nsnull);
|
||||
}
|
||||
|
||||
if (mDeviceContext)
|
||||
mDeviceContext->FlushFontCache();
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user