issueNo: I4DNDZ
Description: fix the bug of failure probability of triggering click event
Feature or Bugfix:Bugfix
Binary Source:No

Signed-off-by: youzhi92 <chenyouzhi@huawei.com>
Change-Id: I5de3179f34f8bd49ae2b8aef8b6f5c5ed42d5afb
This commit is contained in:
youzhi92
2021-10-13 10:56:34 +08:00
parent ece9b3dee5
commit ed523afb31
3 changed files with 8 additions and 4 deletions
+2
View File
@@ -52,6 +52,7 @@ void CallbackExecutor(void *data)
JSValue args[argsLength] = {params->arg};
JSRelease(JSFunction::Call(params->fn, params->vm, args, argsLength));
JSRelease(params->arg);
JSRelease(params->vm);
delete params;
params = nullptr;
}
@@ -126,6 +127,7 @@ void EventUtil::InvokeCallback(JSValue vm, JSValue callback, JSValue event, cons
HILOG_ERROR(HILOG_MODULE_ACE, "EventUtil::InvokeCallback failed: Async task dispatch failure.");
delete params;
params = nullptr;
JSRelease(vm);
JSRelease(event);
}
}
@@ -146,8 +146,8 @@ bool ViewOnSwipeListener::OnDragEnd(UIView& view, const DragEvent &event)
HILOG_DEBUG(HILOG_MODULE_ACE, "OnDragEnd received");
JSValue arg = EventUtil::CreateSwipeEvent(view, event);
EventUtil::InvokeCallback(JSUndefined::Create(), fn_, arg, this);
JSValue vm = GetRootAbilitySlice();
EventUtil::InvokeCallback(vm, fn_, arg, this);
return isStopPropagation_;
}
} // namespace ACELite
@@ -108,7 +108,8 @@ public:
return isStopPropagation_;
}
JSValue arg = EventUtil::CreateEvent(EventUtil::EVENT_CLICK, view, event);
EventUtil::InvokeCallback(JSUndefined::Create(), fn_, arg, this);
JSValue vm = GetRootAbilitySlice();
EventUtil::InvokeCallback(vm, fn_, arg, this);
return isStopPropagation_;
}
@@ -143,7 +144,8 @@ public:
}
JSValue arg = EventUtil::CreateEvent(EventUtil::EVENT_LONGPRESS, view, event);
EventUtil::InvokeCallback(JSUndefined::Create(), fn_, arg, this);
JSValue vm = GetRootAbilitySlice();
EventUtil::InvokeCallback(vm, fn_, arg, this);
return isStopPropagation_;
}