diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index bd04e671115..d2c1860f227 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -1928,6 +1928,9 @@ PresShell::Destroy() // pres shell to NULL if (mPresContext) { mPresContext->SetShell(nsnull); + + // Clear the link handler (weak reference) as well + mPresContext->SetLinkHandler(nsnull); } if (mViewEventListener) { diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index bd04e671115..d2c1860f227 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -1928,6 +1928,9 @@ PresShell::Destroy() // pres shell to NULL if (mPresContext) { mPresContext->SetShell(nsnull); + + // Clear the link handler (weak reference) as well + mPresContext->SetLinkHandler(nsnull); } if (mViewEventListener) {