From bdad3f198cfe4fb97c3bc44bdbde6b1e83ddd5ef Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Fri, 2 Aug 2013 14:00:35 -0700 Subject: [PATCH] Weaken the assertion in JS_ShutDown into a stderr printf, and hope (ha, ha, ha) that people will pay attention to it at all. Followup to bug 896124, rs=luke over IRC --HG-- extra : rebase_source : 4665a8596682aefefb5d3535d692b86178931a41 --- js/src/jsapi.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 599454b22c8..60568b6ab3e 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -706,8 +706,15 @@ JS_ShutDown(void) { MOZ_ASSERT(jsInitState == Running, "JS_ShutDown must only be called after JS_Init and can't race with it"); - MOZ_ASSERT(!JSRuntime::hasLiveRuntimes(), - "forgot to destroy a runtime before shutting down"); +#ifdef DEBUG + if (JSRuntime::hasLiveRuntimes()) { + // Gecko is too buggy to assert this just yet. + fprintf(stderr, + "WARNING: YOU ARE LEAKING THE WORLD (at least one JSRuntime " + "and everything alive inside it, that is) AT JS_ShutDown " + "TIME. FIX THIS!\n"); + } +#endif PRMJ_NowShutdown();