mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-19 14:43:36 -04:00
fix Mac FastPreview bug
Signed-off-by: lihao <lihao71@huawei.com> Change-Id: I0b6b18d36250d4679e77f1894f9162475a5861e7
This commit is contained in:
@@ -491,7 +491,8 @@ bool AceAbility::OperateComponent(const std::string& attrsJson)
|
||||
auto container = AceContainer::GetContainerInstance(ACE_INSTANCE_ID);
|
||||
auto taskExecutor = container->GetTaskExecutor();
|
||||
taskExecutor->PostTask(
|
||||
[attrsJson] {
|
||||
[attrsJson, instanceId = ACE_INSTANCE_ID] {
|
||||
ContainerScope scope(instanceId);
|
||||
bool result = OHOS::Ace::Framework::InspectorClient::GetInstance().OperateComponent(attrsJson);
|
||||
if (!result) {
|
||||
OHOS::Ace::Framework::InspectorClient::GetInstance().CallFastPreviewErrorCallback(attrsJson);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@@ -17,11 +17,7 @@
|
||||
|
||||
namespace OHOS::Ace {
|
||||
|
||||
#ifndef WINDOWS_PLATFORM
|
||||
thread_local int32_t ContainerScope::currentId_ = -1;
|
||||
#else
|
||||
int32_t ContainerScope::currentId_ = -1;
|
||||
#endif
|
||||
std::function<void(int32_t)> ContainerScope::updateScopeNotify_;
|
||||
|
||||
int32_t ContainerScope::CurrentId()
|
||||
|
||||
@@ -44,11 +44,7 @@ public:
|
||||
static void SetScopeNotify(std::function<void(int32_t)>&& notify);
|
||||
|
||||
private:
|
||||
#ifndef WINDOWS_PLATFORM
|
||||
static thread_local int32_t currentId_;
|
||||
#else
|
||||
static int32_t currentId_;
|
||||
#endif
|
||||
int32_t restoreId_ = -1;
|
||||
static std::function<void(int32_t)> updateScopeNotify_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user