From 3d8f4dd57d1cea7ef3322a285d88eb404865b33f Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Thu, 20 Jan 2011 22:10:54 -0800 Subject: [PATCH] Bug 627758 - Detect forced GC end case to fix jsd.off() giving NS_ERROR_NOT_AVAILABLE, r=dmandelin --HG-- extra : rebase_source : 6525e0b9abca2b0096d3fe0d5b8248dcfaebe7ba --- js/jsd/jsd_xpc.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index fe1347d49370..fab8cddea07b 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -523,8 +523,14 @@ jsds_GCCallbackProc (JSContext *cx, JSGCStatus status) } gGCStatus = status; - if (gLastGCProc) - return gLastGCProc (cx, status); + if (gLastGCProc && !gLastGCProc (cx, status)) { + /* + * If gLastGCProc returns false, then we're going to abort out + * of this GC pass without a JSGC_END callback. + */ + gGCStatus = JSGC_END; + return JS_FALSE; + } return JS_TRUE; } @@ -2595,7 +2601,8 @@ jsdService::Off (void) return NS_ERROR_NOT_AVAILABLE; JSContext *cx = JSD_GetDefaultJSContext(mCx); - jsds_NotifyPendingDeadScripts(cx); + while (gDeadScripts) + jsds_NotifyPendingDeadScripts (cx); } /*