Bug 1535800 - Part 2: Don't attempt to resume loading within in a destroyed docshell, r=qdot
authorNika Layzell <nika@thelayzells.com>
Thu, 09 May 2019 21:11:06 +0000
changeset 535851 2ed4342ee7ccfc331543bb221add2696d38583bd
parent 535850 9b3e897d5a6ad159a1ab1e895b502fe0b2e40cbf
child 535852 8887ea101536a4c3eb09cb5fbf2b04ff9dc9fc8e
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1535800
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 1535800 - Part 2: Don't attempt to resume loading within in a destroyed docshell, r=qdot Differential Revision: https://phabricator.services.mozilla.com/D30559
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -13136,16 +13136,20 @@ NS_IMETHODIMP
 nsDocShell::ResumeRedirectedLoad(uint64_t aIdentifier, int32_t aHistoryIndex) {
   RefPtr<nsDocShell> self = this;
   RefPtr<ChildProcessChannelListener> cpcl =
       ChildProcessChannelListener::GetSingleton();
 
   // Call into InternalLoad with the pending channel when it is received.
   cpcl->RegisterCallback(
       aIdentifier, [self, aHistoryIndex](nsIChildChannel* aChannel) {
+        if (NS_WARN_IF(self->mIsBeingDestroyed)) {
+          return;
+        }
+
         RefPtr<nsDocShellLoadState> loadState;
         nsresult rv = nsDocShellLoadState::CreateFromPendingChannel(
             aChannel, getter_AddRefs(loadState));
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return;
         }
 
         // If we're performing a history load, locate the correct history entry,