!48270 loadDocument流程添加localScope

Merge pull request !48270 from fangzhiyuan/uicontext2
This commit is contained in:
openharmony_ci 2024-11-11 15:56:24 +00:00 committed by Gitee
commit eef011eb95
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 0 deletions

View File

@ -1498,6 +1498,7 @@ bool JsiDeclarativeEngine::UpdateRootComponent()
{
if (!JsiDeclarativeEngine::obj_.IsEmpty()) {
LOGI("update rootComponent start");
LocalScope scope(obj_.GetEcmaVM());
Framework::UpdateRootComponent(obj_.GetEcmaVM(), JsiDeclarativeEngine::obj_.ToLocal());
// Clear the global object to avoid load this obj next time
JsiDeclarativeEngine::obj_.FreeGlobalHandleAddr();

View File

@ -238,6 +238,7 @@ void UpdateCardRootComponent(const EcmaVM* vm, const panda::Local<panda::ObjectR
panda::Local<panda::JSValueRef> JsLoadDocument(panda::JsiRuntimeCallInfo* runtimeCallInfo)
{
EcmaVM* vm = runtimeCallInfo->GetVM();
LocalScope scope(vm);
uint32_t argc = runtimeCallInfo->GetArgsNumber();
if (argc != 1) {
return panda::JSValueRef::Undefined(vm);