From 98aa66e3aaf593128dda9ad7a66bde619d9bcb62 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Fri, 3 Apr 2020 18:54:16 -0700 Subject: [PATCH] #596: chemspill M1626728 1620818 --- docshell/base/nsDocShell.cpp | 6 ++++++ dom/cache/StreamList.cpp | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 58a091739..aca78eeb7 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -856,6 +856,12 @@ nsDocShell::~nsDocShell() shPrivate->SetRootDocShell(nullptr); } + if (mContentViewer) { + mContentViewer->Close(nullptr); + mContentViewer->Destroy(); + mContentViewer = nullptr; + } + if (--gDocShellCount == 0) { NS_IF_RELEASE(sURIFixup); } diff --git a/dom/cache/StreamList.cpp b/dom/cache/StreamList.cpp index 3e3ac2a67..6ca3a62b9 100644 --- a/dom/cache/StreamList.cpp +++ b/dom/cache/StreamList.cpp @@ -138,7 +138,15 @@ StreamList::CloseAll() { NS_ASSERT_OWNINGTHREAD(StreamList); if (mStreamControl) { - mStreamControl->CloseAll(); + auto streamControl = mStreamControl; + mStreamControl = nullptr; + + streamControl->CloseAll(); + + mStreamControl = streamControl; + streamControl = nullptr; + + mStreamControl->Shutdown(); } }