Skip to content

Commit

Permalink
[unity]v2用例修复
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Apr 9, 2024
1 parent 0fb03e1 commit 2881eac
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions unity/native_src_il2cpp/Src/Puerts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ static v8::Value* GetModuleExecutor(v8::Context* env)
auto ret = pesapi_eval((pesapi_env) env, (const uint8_t*) ExecuteModuleJSCode, strlen(ExecuteModuleJSCode), "__puer_execute__.mjs");

auto Isolate = Context->GetIsolate();
v8::HandleScope HandleScope(Isolate);
v8::Context::Scope ContextScope(Context);
v8::Local<v8::Object> Global = Context->Global();
auto Ret = Global->Get(Context, v8::String::NewFromUtf8(Isolate, EXECUTEMODULEGLOBANAME).ToLocalChecked());
v8::Local<v8::Value> Func;
Expand All @@ -300,7 +298,7 @@ static v8::Value* GetModuleExecutor(v8::Context* env)
return *Func;
}

return *v8::FunctionTemplate::New(Isolate, puerts::esmodule::ExecuteModule)->GetFunction(Context).ToLocalChecked();;
return nullptr;
}

static void* GetJSObjectValue(const PersistentObjectInfo* objectInfo, const char* key, const void* Typeid)
Expand Down

1 comment on commit 2881eac

@chexiongsheng
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HandleScope会回收当前变量,导致变量无效

Please sign in to comment.