Bug 863766 - crash when destroying a JSContext with outstanding requests. r=luke
authorAndrew McCreight <amccreight@mozilla.com>
Tue, 23 Apr 2013 09:56:02 -0700
changeset 140598 8a4e38fbd3f7f2b63ff7fa252137bdacde7e6d71
parent 140597 7722c041120eb107db0401aa45910d833cf04fe3
child 140599 3c0e77a706f47a2b2a337a1de0e67e497d462190
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs863766
milestone23.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 863766 - crash when destroying a JSContext with outstanding requests. r=luke
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -358,17 +358,18 @@ js::NewContext(JSRuntime *rt, size_t sta
 
 void
 js::DestroyContext(JSContext *cx, DestroyContextMode mode)
 {
     JSRuntime *rt = cx->runtime;
     JS_AbortIfWrongThread(rt);
 
 #ifdef JS_THREADSAFE
-    JS_ASSERT(cx->outstandingRequests == 0);
+    if (cx->outstandingRequests != 0)
+        MOZ_CRASH();
 #endif
 
     if (mode != DCM_NEW_FAILED) {
         if (JSContextCallback cxCallback = rt->cxCallback) {
             /*
              * JSCONTEXT_DESTROY callback is not allowed to fail and must
              * return true.
              */