Commit 8bd29055 authored by Nika Layzell's avatar Nika Layzell
Browse files

Bug 1725572 - Wait for parent ack when discarding BC from child, r=kmag

I am not confident that this will fix the underlying issue causing this crash,
but given how small of a change it is, I figure it's worth trying to land
quickly to see if the crash rate drops with it.

Differential Revision: https://phabricator.services.mozilla.com/D124503
parent f0dde51a
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -859,7 +859,10 @@ void BrowsingContext::Detach(bool aFromIPC) {
      }
      }
    });
    });
  } else if (!aFromIPC) {
  } else if (!aFromIPC) {
    auto callback = [](auto) {};
    // Hold a strong reference to ourself until the responses come back to
    // ensure the BrowsingContext isn't cleaned up before the parent process
    // acknowledges the discard request.
    auto callback = [self = RefPtr{this}](auto) {};
    ContentChild::GetSingleton()->SendDiscardBrowsingContext(this, callback,
    ContentChild::GetSingleton()->SendDiscardBrowsingContext(this, callback,
                                                             callback);
                                                             callback);
  }
  }