Bug 1282671 - Loose the assertion checking win->IsDying(). r=bholly
authorHo-Pang Hsu <hopang.hsu@gmail.com>
Wed, 12 Oct 2016 19:49:00 +0200
changeset 317714 ba66a8bb5b3da146e65251bc2d2771c87f4d593c
parent 317713 42ef5d8cd77715faa645866eaaa596f8bbd30182
child 317715 c09788a9b52bbed072ba9c4714f36c777d489ed1
push id82722
push usercbook@mozilla.com
push dateThu, 13 Oct 2016 06:25:51 +0000
treeherdermozilla-inbound@d9dd5cab64b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholly
bugs1282671
milestone52.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 1282671 - Loose the assertion checking win->IsDying(). r=bholly
js/xpconnect/src/XPCJSContext.cpp
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -1313,17 +1313,23 @@ XPCJSContext::InterruptCallback(JSContex
         }
     }
 
     if (!win) {
         NS_WARNING("No active window");
         return true;
     }
 
-    MOZ_ASSERT(!win->IsDying());
+    if (win->IsDying()) {
+        // The window is being torn down. When that happens we try to prevent
+        // the dispatch of new runnables, so it also makes sense to kill any
+        // long-running script. The user is primarily interested in this page
+        // going away.
+        return false;
+    }
 
     if (win->GetIsPrerendered()) {
         // We cannot display a dialog if the page is being prerendered, so
         // just kill the page.
         mozilla::dom::HandlePrerenderingViolation(win->AsInner());
         return false;
     }