diff options
-rw-r--r-- | src/mongo/scripting/mozjs/implscope.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/scripting/mozjs/implscope.cpp b/src/mongo/scripting/mozjs/implscope.cpp index 6a250c0b897..72de902359a 100644 --- a/src/mongo/scripting/mozjs/implscope.cpp +++ b/src/mongo/scripting/mozjs/implscope.cpp @@ -246,6 +246,10 @@ void MozJSImplScope::_gcCallback(JSRuntime* rt, JSGCStatus status, void* data) { } MozJSImplScope::MozRuntime::MozRuntime(const MozJSScriptEngine* engine) { + // While we're initializing the runtime/scope, calling MozJSImplScope::getThreadScope() should + // return a nullptr. + kCurrentScope = nullptr; + /** * The maximum amount of memory to be given out per thread to mozilla. We * manage this by trapping all calls to malloc, free, etc. and keeping track of |