diff --git a/native/cocos/editor-support/MiddlewareManager.cpp b/native/cocos/editor-support/MiddlewareManager.cpp index 21e66aaca80..74f9447eb34 100644 --- a/native/cocos/editor-support/MiddlewareManager.cpp +++ b/native/cocos/editor-support/MiddlewareManager.cpp @@ -143,15 +143,16 @@ void MiddlewareManager::render(float dt) { } void MiddlewareManager::addTimer(IMiddleware *editor) { - auto it0 = std::find(_updateList.begin(), _updateList.end(), editor); - if (it0 != _updateList.end()) { - return; - } - auto it1 = std::find(_removeList.begin(), _removeList.end(), editor); if (it1 != _removeList.end()) { _removeList.erase(it1); } + + auto it0 = std::find(_updateList.begin(), _updateList.end(), editor); + if (it0 != _updateList.end()) { + return; + } + _updateList.push_back(editor); }