From ea1ffcd54c27b8c9a55e6bb5b5aab7c759d3b88d Mon Sep 17 00:00:00 2001 From: Ho-Pang Hsu Date: Wed, 12 Oct 2016 19:49:00 +0200 Subject: [PATCH] Bug 1282671 - Loose the assertion checking win->IsDying(). r=bholly --- js/xpconnect/src/XPCJSContext.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp index 861662028f30..522e33560f0e 100644 --- a/js/xpconnect/src/XPCJSContext.cpp +++ b/js/xpconnect/src/XPCJSContext.cpp @@ -1318,7 +1318,13 @@ XPCJSContext::InterruptCallback(JSContext* cx) 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