@@ -15,7 +15,7 @@ struct FuncFinalizeData
1515
1616void PApiFuncFinalizer (JSRuntime* rt, JSValue val)
1717{
18- CppObjectMapper* mapper = reinterpret_cast <CppObjectMapper*>(JS_GetRuntimeOpaque (rt));
18+ CppObjectMapper* mapper = reinterpret_cast <CppObjectMapper*>(JS_GetRuntimeOpaque1 (rt));
1919 FuncFinalizeData* data = (FuncFinalizeData*)JS_GetOpaque (val, mapper->funcTracerClassId );
2020 if (data->finalize )
2121 {
@@ -68,7 +68,7 @@ JSValue CppObjectMapper::CreateError(JSContext* ctx, const char* message)
6868
6969void PApiObjectFinalizer (JSRuntime* rt, JSValue val)
7070{
71- CppObjectMapper* mapper = reinterpret_cast <CppObjectMapper*>(JS_GetRuntimeOpaque (rt));
71+ CppObjectMapper* mapper = reinterpret_cast <CppObjectMapper*>(JS_GetRuntimeOpaque1 (rt));
7272 ObjectUserData* object_udata = (ObjectUserData*)JS_GetOpaque (val, mapper->classId );
7373
7474 if (object_udata->callFinalize && object_udata->typeInfo ->Finalize )
@@ -338,7 +338,7 @@ void CppObjectMapper::Initialize(JSContext* ctx_)
338338{
339339 ctx = ctx_;
340340 rt = JS_GetRuntime (ctx);
341- JS_SetRuntimeOpaque (rt, this );
341+ JS_SetRuntimeOpaque1 (rt, this );
342342 // new (&CDataCache) eastl::unordered_map<const void*, FObjectCacheNode, eastl::hash<const void*>,
343343 // eastl::equal_to<const void*>, eastl::allocator_malloc>();
344344 // new (&TypeIdToFunctionMap) eastl::unordered_map<const void*, JSValue, eastl::hash<const void*>,
@@ -441,7 +441,7 @@ void destroy_qjs_env(pesapi_env_ref env_ref)
441441 // auto scope = pesapi::qjsimpl::g_pesapi_ffi.open_scope(env_ref);
442442 JSContext* ctx = reinterpret_cast <JSContext*>(pesapi::qjsimpl::g_pesapi_ffi.get_env_from_ref (env_ref));
443443 JSRuntime* rt = JS_GetRuntime (ctx);
444- pesapi::qjsimpl::CppObjectMapper* mapper = reinterpret_cast < pesapi::qjsimpl::CppObjectMapper*>( JS_GetRuntimeOpaque (rt) );
444+ pesapi::qjsimpl::CppObjectMapper* mapper = pesapi::qjsimpl::CppObjectMapper::Get (ctx );
445445 // pesapi::qjsimpl::g_pesapi_ffi.close_scope(scope);
446446 pesapi::qjsimpl::g_pesapi_ffi.release_env_ref (env_ref);
447447 mapper->Cleanup ();
0 commit comments