Bug 1643874. r=smaug, a=jcristau
authorMike Conley <mconley@mozilla.com>
Fri, 12 Jun 2020 14:30:29 +0000
changeset 524861 f60d8342433b0e9e25f2c98dc63fc98dc058fe9c
parent 524860 d0f412d119cc386465387770b6c1994d6f6108a5
child 524862 701d20f4cfb68b411d2565388158ddd925db6940
push id1059
push userjcristau@mozilla.com
push dateThu, 18 Jun 2020 12:37:14 +0000
treeherdermozilla-esr68@701d20f4cfb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, jcristau
bugs1643874
milestone68.10.0
Bug 1643874. r=smaug, a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D79472
dom/base/nsGlobalWindowInner.cpp
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -6396,16 +6396,18 @@ void nsGlobalWindowInner::CallDocumentFl
   CallOrCancelDocumentFlushedResolvers<true>();
 }
 
 void nsGlobalWindowInner::CancelDocumentFlushedResolvers() {
   CallOrCancelDocumentFlushedResolvers<false>();
 }
 
 void nsGlobalWindowInner::DidRefresh() {
+  RefPtr<nsGlobalWindowInner> kungFuDeathGrip(this);
+
   auto rejectionGuard = MakeScopeExit([&] {
     CancelDocumentFlushedResolvers();
     mObservingDidRefresh = false;
   });
 
   MOZ_ASSERT(mDoc);
 
   PresShell* presShell = mDoc->GetPresShell();