From 64db46075ae7f42ceb8d0570d560e6fa57cb0f9d Mon Sep 17 00:00:00 2001 From: Fedor Date: Sun, 12 Apr 2020 13:02:51 +0300 Subject: [PATCH] [Docshell] Ensure nsDocShell::mContentViewer is released properly. --- docshell/base/nsDocShell.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 8a96cf724..8b39e03a0 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -859,6 +859,12 @@ nsDocShell::~nsDocShell() shPrivate->SetRootDocShell(nullptr); } + if (mContentViewer) { + mContentViewer->Close(nullptr); + mContentViewer->Destroy(); + mContentViewer = nullptr; + } + if (--gDocShellCount == 0) { NS_IF_RELEASE(sURIFixup); }