From 2586ead606d6edf9cb303ab266f46a665e6dbf84 Mon Sep 17 00:00:00 2001 From: bofeng Date: Wed, 11 Dec 2024 09:22:28 +0800 Subject: [PATCH] Fix spine can not show normally after disable and then active node. --- native/cocos/editor-support/MiddlewareManager.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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); }