diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 5d6c04588598..d33c67c3b83c 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -1475,6 +1475,10 @@ nsWindow::~nsWindow() { gTopLevelWindows.RemoveElement(this); ALOG("nsWindow %p destructor", (void*)this); + // The mCompositorSession should have been cleaned up in nsWindow::Destroy() + // DestroyLayerManager() will call DestroyCompositor() which will crash if + // called from nsBaseWidget destructor. See Bug 1392705 + MOZ_ASSERT(!mCompositorSession); } bool @@ -1546,6 +1550,9 @@ nsWindow::Destroy() mChildren[0]->SetParent(nullptr); } + // Ensure the compositor has been shutdown before this nsWindow is potentially deleted + nsBaseWidget::DestroyCompositor(); + nsBaseWidget::Destroy(); if (IsTopLevel())