summaryrefslogtreecommitdiffstats
path: root/docshell/base/nsDocShell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'docshell/base/nsDocShell.cpp')
-rw-r--r--docshell/base/nsDocShell.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index f005c5f..9da5fb3 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -316,7 +316,6 @@ nsDocShell::nsDocShell()
mForcedCharset(nullptr),
mParentCharset(nullptr),
mTreeOwner(nullptr),
- mChromeEventHandler(nullptr),
mDefaultScrollbarPref(Scrollbar_Auto, Scrollbar_Auto),
mCharsetReloadState(eCharsetReloadInit),
mOrientationLock(eScreenOrientation_None),
@@ -492,7 +491,7 @@ void nsDocShell::DestroyChildren() {
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsDocShell, nsDocLoader,
mSessionStorageManager, mScriptGlobal,
- mInitialClientSource)
+ mInitialClientSource, mChromeEventHandler)
NS_IMPL_ADDREF_INHERITED(nsDocShell, nsDocLoader)
NS_IMPL_RELEASE_INHERITED(nsDocShell, nsDocLoader)
@@ -1343,9 +1342,7 @@ nsDocShell::GetContentViewer(nsIContentViewer** aContentViewer) {
NS_IMETHODIMP
nsDocShell::SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler) {
- // Weak reference. Don't addref.
- nsCOMPtr<EventTarget> handler = do_QueryInterface(aChromeEventHandler);
- mChromeEventHandler = handler.get();
+ mChromeEventHandler = do_QueryInterface(aChromeEventHandler);
if (mScriptGlobal) {
mScriptGlobal->SetChromeEventHandler(mChromeEventHandler);
@@ -5302,6 +5299,8 @@ nsDocShell::Destroy() {
SetTreeOwner(nullptr);
+ mChromeEventHandler = nullptr;
+
mOnePermittedSandboxedNavigator = nullptr;
// required to break ref cycle