diff --git a/native/cocos/scripting/js-bindings/event/EventDispatcher.cpp b/native/cocos/scripting/js-bindings/event/EventDispatcher.cpp index 1031252aa8..66e21875fc 100644 --- a/native/cocos/scripting/js-bindings/event/EventDispatcher.cpp +++ b/native/cocos/scripting/js-bindings/event/EventDispatcher.cpp @@ -97,7 +97,7 @@ void EventDispatcher::dispatchTouchEvent(const struct TouchEvent& touchEvent) _jsTouchObjArray->setProperty("length", se::Value(touchEvent.touches.size())); - if (_jsTouchObjPool.size() < touchEvent.touches.size()) + while (_jsTouchObjPool.size() < touchEvent.touches.size()) { se::Object* touchObj = se::Object::createPlainObject(); touchObj->root();