From d562edcb6e15801d77e4be09cf2c0314fe7020db Mon Sep 17 00:00:00 2001 From: firminly Date: Thu, 14 Mar 2024 14:37:15 +0800 Subject: [PATCH] NDK C-API fix crash problem Signed-off-by: liyi0309 Change-Id: Ib3df5129bdf9ab0b7d36fb3a5be58498f8712354 --- .../pattern/loading_progress/loading_progress_model_ng.cpp | 2 +- .../components_ng/pattern/progress/progress_model_ng.cpp | 2 +- interfaces/native/node/node_model.cpp | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/frameworks/core/components_ng/pattern/loading_progress/loading_progress_model_ng.cpp b/frameworks/core/components_ng/pattern/loading_progress/loading_progress_model_ng.cpp index 576ea27200f..9268b918543 100644 --- a/frameworks/core/components_ng/pattern/loading_progress/loading_progress_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/loading_progress/loading_progress_model_ng.cpp @@ -53,7 +53,7 @@ void LoadingProgressModelNG::SetEnableLoading(bool enable) uint32_t LoadingProgressModelNG::GetColor(FrameNode* frameNode) { Color value; - ACE_GET_NODE_PAINT_PROPERTY(LoadingProgressPaintProperty, Color, value, frameNode); + ACE_GET_NODE_PAINT_PROPERTY_WITH_DEFAULT_VALUE(LoadingProgressPaintProperty, Color, value, frameNode, value); return value.GetValue(); } diff --git a/frameworks/core/components_ng/pattern/progress/progress_model_ng.cpp b/frameworks/core/components_ng/pattern/progress/progress_model_ng.cpp index baa0934262d..1ac95b7c1ab 100644 --- a/frameworks/core/components_ng/pattern/progress/progress_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/progress/progress_model_ng.cpp @@ -553,7 +553,7 @@ double ProgressModelNG::GetValue(FrameNode* frameNode) Color ProgressModelNG::GetColor(FrameNode* frameNode) { Color value; - ACE_GET_NODE_PAINT_PROPERTY(ProgressPaintProperty, Color, value, frameNode); + ACE_GET_NODE_PAINT_PROPERTY_WITH_DEFAULT_VALUE(ProgressPaintProperty, Color, value, frameNode, value); return value; } diff --git a/interfaces/native/node/node_model.cpp b/interfaces/native/node/node_model.cpp index debdb97ee69..ba40873b7a6 100644 --- a/interfaces/native/node/node_model.cpp +++ b/interfaces/native/node/node_model.cpp @@ -135,10 +135,7 @@ ArkUI_NodeHandle CreateNode(ArkUI_NodeType type) return nullptr; } - ArkUI_Int32 id = -1; - if (nodeType == ARKUI_NODE_LOADING_PROGRESS || nodeType == ARKUI_NODE_TEXT || nodeType == ARKUI_NODE_TEXT_INPUT) { - id = ARKUI_AUTO_GENERATE_NODE_ID; - } + ArkUI_Int32 id = ARKUI_AUTO_GENERATE_NODE_ID; auto* uiNode = impl->getBasicAPI()->createNode(nodes[nodeType - 1], id, 0); if (!uiNode) { TAG_LOGE(AceLogTag::ACE_NATIVE_NODE, "node type: %{public}d can not find in full impl", type); -- Gitee