Changeset 15437 in webkit for trunk/JavaScriptCore/API/JSContextRef.cpp
- Timestamp:
- Jul 14, 2006, 3:39:58 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSContextRef.cpp
r15428 r15437 35 35 using namespace KJS; 36 36 37 JS ContextRef JSContextCreate(JSClassRef globalObjectClass)37 JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) 38 38 { 39 39 JSLock lock; … … 47 47 48 48 Interpreter* interpreter = new Interpreter(globalObject); // adds the built-in object prototype to the global object 49 return toRef(interpreter->globalExec()); 49 JSGlobalContextRef context = reinterpret_cast<JSGlobalContextRef>(interpreter->globalExec()); 50 return JSGlobalContextRetain(context); 50 51 } 51 52 52 void JSContextDestroy(JSContextRef context)53 JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef context) 53 54 { 54 55 JSLock lock; 55 56 ExecState* exec = toJS(context); 56 delete exec->dynamicInterpreter(); 57 exec->dynamicInterpreter()->ref(); 58 return context; 59 } 60 61 void JSGlobalContextRelease(JSGlobalContextRef context) 62 { 63 JSLock lock; 64 ExecState* exec = toJS(context); 65 exec->dynamicInterpreter()->deref(); 57 66 } 58 67
Note:
See TracChangeset
for help on using the changeset viewer.