native plugin: fix assertion (#13721)

* native plugin: fix assertion
This commit is contained in:
江战
2022-12-08 13:45:09 +08:00
committed by GitHub
parent b73351ee15
commit 33d9dca1bd
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ jobs:
sudo apt install ninja-build -y
- name: Compile
env:
COCOS_ENGINE_DEV: 1
COCOS_ENGINE_DEV: 0
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
echo "Compiling Linux ... "
+2 -2
View File
@@ -23,7 +23,7 @@
THE SOFTWARE.
****************************************************************************/
#include "plugins/bus/EventBus.h"
#include <cassert>
#include "base/Macros.h"
#include <cstring>
#include <unordered_map>
@@ -52,7 +52,7 @@ EventBus *EventBus::acquire(BusType type) {
}
void EventBus::addListener(Listener *listener) {
assert(std::find(_listeners.begin(), _listeners.end(), listener) != _listeners.end());
CC_ASSERT(std::find(_listeners.begin(), _listeners.end(), listener) == _listeners.end());
_listeners.emplace_back(listener);
}