From df4ee569d6897d13670af93047e832bd64a90f49 Mon Sep 17 00:00:00 2001 From: "timeless@mozdev.org" Date: Sun, 23 May 2010 15:37:31 -0700 Subject: [PATCH] Bug 565593 crash [@ js_DestroyContext] if JS_NewContext fails in CancelExecution. r=jorendorff --HG-- extra : rebase_source : a3d5e11c53a042e786560b90c2039f9183329a22 --- js/src/shell/js.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 5afeaca3e7d5..0c4228225b05 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -3591,9 +3591,10 @@ CancelExecution(JSRuntime *rt) #ifdef JS_THREADSAFE if (gWorkers) { JSContext *cx = JS_NewContext(rt, 8192); - if (cx) + if (cx) { js::workers::terminateAll(cx, gWorkers); - JS_DestroyContextNoGC(cx); + JS_DestroyContextNoGC(cx); + } } #endif JS_TriggerAllOperationCallbacks(rt);