fix Mac FastPreview bug

Signed-off-by: lihao <lihao71@huawei.com>
Change-Id: I0b6b18d36250d4679e77f1894f9162475a5861e7
This commit is contained in:
lihao
2022-04-07 14:47:39 +08:00
parent fc4e055480
commit c6dd4fa37f
3 changed files with 3 additions and 10 deletions
+2 -1
View File
@@ -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
View File
@@ -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()
-4
View File
@@ -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_;