!34917 NDK C-API 稳定性问题修复

Merge pull request !34917 from firminly/liyi6
This commit is contained in:
openharmony_ci 2024-06-05 12:52:49 +00:00 committed by Gitee
commit 58aeae585e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 17 additions and 2 deletions

View File

@ -344,7 +344,10 @@ double LongPressRecognizer::ConvertPxToVp(double offset) const
void LongPressRecognizer::SendCallbackMsg(
const std::unique_ptr<GestureEventFunc>& callback, bool isRepeat, bool isOnAction)
{
if (callback && *callback && !gestureInfo_->GetDisposeTag()) {
if (gestureInfo_ && gestureInfo_->GetDisposeTag()) {
return;
}
if (callback && *callback) {
GestureEvent info;
info.SetTimeStamp(time_);
info.SetRepeat(isRepeat);

View File

@ -275,6 +275,9 @@ void SetAttribute(ArkUI_NodeHandle node, ArkUI_NodeAttributeType attribute, cons
int32_t SetAttribute(ArkUI_NodeHandle node, ArkUI_NodeAttributeType attribute, const ArkUI_AttributeItem* value)
{
if (node == nullptr) {
return ERROR_CODE_PARAM_INVALID;
}
if (node->type == -1) {
return ERROR_CODE_NATIVE_IMPL_BUILDER_NODE_ERROR;
}
@ -283,6 +286,9 @@ int32_t SetAttribute(ArkUI_NodeHandle node, ArkUI_NodeAttributeType attribute, c
int32_t ResetAttribute(ArkUI_NodeHandle node, ArkUI_NodeAttributeType attribute)
{
if (node == nullptr) {
return ERROR_CODE_PARAM_INVALID;
}
if (node->type == -1) {
return ERROR_CODE_NATIVE_IMPL_BUILDER_NODE_ERROR;
}
@ -291,6 +297,9 @@ int32_t ResetAttribute(ArkUI_NodeHandle node, ArkUI_NodeAttributeType attribute)
const ArkUI_AttributeItem* GetAttribute(ArkUI_NodeHandle node, ArkUI_NodeAttributeType attribute)
{
if (node == nullptr) {
return nullptr;
}
return GetNodeAttribute(node, attribute);
}
@ -301,7 +310,7 @@ int32_t RegisterNodeEvent(ArkUI_NodeHandle nodePtr, ArkUI_NodeEventType eventTyp
int32_t RegisterNodeEvent(ArkUI_NodeHandle nodePtr, ArkUI_NodeEventType eventType, int32_t targetId, void* userData)
{
if (!nodePtr) {
if (nodePtr == nullptr) {
return ERROR_CODE_PARAM_INVALID;
}
auto originEventType = ConvertOriginEventType(eventType, nodePtr->type);
@ -352,6 +361,9 @@ int32_t RegisterNodeEvent(ArkUI_NodeHandle nodePtr, ArkUI_NodeEventType eventTyp
void UnregisterNodeEvent(ArkUI_NodeHandle nodePtr, ArkUI_NodeEventType eventType)
{
if (nodePtr == nullptr) {
return;
}
if (!nodePtr->extraData) {
return;
}