summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/API/JSContextRef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/API/JSContextRef.cpp')
-rw-r--r--Source/JavaScriptCore/API/JSContextRef.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/API/JSContextRef.cpp b/Source/JavaScriptCore/API/JSContextRef.cpp
index e5c778f..03d0622 100644
--- a/Source/JavaScriptCore/API/JSContextRef.cpp
+++ b/Source/JavaScriptCore/API/JSContextRef.cpp
@@ -97,12 +97,12 @@ JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClass
return JSGlobalContextRetain(toGlobalRef(globalObject->globalExec()));
}
- JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(globalObjectClass, JSCallbackObject<JSGlobalObject>::createStructure(*globalData, jsNull()));
+ JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(*globalData, globalObjectClass, JSCallbackObject<JSGlobalObject>::createStructure(*globalData, jsNull()));
ExecState* exec = globalObject->globalExec();
JSValue prototype = globalObjectClass->prototype(exec);
if (!prototype)
prototype = jsNull();
- globalObject->resetPrototype(prototype);
+ globalObject->resetPrototype(*globalData, prototype);
return JSGlobalContextRetain(toGlobalRef(exec));
}
@@ -141,9 +141,10 @@ void JSGlobalContextRelease(JSGlobalContextRef ctx)
// it may release a lot of GC memory - run the garbage collector now.
// * If there are more references remaining the the global object, then do nothing
// (specifically that is more protects, which we assume come from other JSGlobalContextRefs).
- if (releasingContextGroup)
+ if (releasingContextGroup) {
+ globalData.clearBuiltinStructures();
globalData.heap.destroy();
- else if (releasingGlobalObject)
+ } else if (releasingGlobalObject)
globalData.heap.collectAllGarbage();
globalData.deref();