mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 02:31:59 +00:00
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
This commit is contained in:
parent
2928361af0
commit
f77571182e
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user