Bug 1545178 - Check that OwnerDoc is non-null within RemoveWindowListeners, r=qdot
authorNika Layzell <nika@thelayzells.com>
Thu, 18 Apr 2019 06:43:40 +0000
changeset 470075 24545a98e9e1a15b075bb27944a33353f385278a
parent 470074 2f8f0e53a7dbb3f6d2259cfb0536a83ff84267ac
child 470076 ee03e8a4f6cd04cfc183a4ed2012c872cb021df0
push id112843
push useraiakab@mozilla.com
push dateFri, 19 Apr 2019 09:50:22 +0000
treeherdermozilla-inbound@c06f27cbfe40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1545178
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1545178 - Check that OwnerDoc is non-null within RemoveWindowListeners, r=qdot This line appears to be perma-failing right now in `Android 7.0 x86-64 opt : M[tier-2](2)`. This seems to be being caused by the PContent's channel being closed during shutdown also causing TabParents to be shut down too late, after the document which they're embedded in has started dying(?) This patch just does the "obvious" thing of adding a null check (due to it looking like a null dereference). Differential Revision: https://phabricator.services.mozilla.com/D27947
dom/ipc/TabParent.cpp
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -365,17 +365,18 @@ void TabParent::AddWindowListeners() {
         eventTarget->AddEventListener(NS_LITERAL_STRING("MozUpdateWindowPos"),
                                       this, false, false);
       }
     }
   }
 }
 
 void TabParent::RemoveWindowListeners() {
-  if (mFrameElement && mFrameElement->OwnerDoc()->GetWindow()) {
+  if (mFrameElement && mFrameElement->OwnerDoc() &&
+      mFrameElement->OwnerDoc()->GetWindow()) {
     nsCOMPtr<nsPIDOMWindowOuter> window =
         mFrameElement->OwnerDoc()->GetWindow();
     nsCOMPtr<EventTarget> eventTarget = window->GetTopWindowRoot();
     if (eventTarget) {
       eventTarget->RemoveEventListener(NS_LITERAL_STRING("MozUpdateWindowPos"),
                                        this, false);
     }
   }