3.3 fix mq restart (#3805)

* fix mq restart
This commit is contained in:
江战
2021-08-06 16:29:59 +08:00
committed by GitHub
parent 60e7c2f2ab
commit 0e23ff79f1
@@ -1,5 +1,7 @@
#include "bindings/auto/jsb_scene_auto.h"
#include "bindings/event/CustomEventTypes.h"
#include "bindings/event/EventDispatcher.h"
#include "jsb_scene_manual.h"
#include "scene/Model.h"
#include "scene/Node.h"
@@ -210,6 +212,10 @@ bool register_all_scene_ext_manual(se::Object *obj) { //NOLINT
msgQueue = se::Object::createArrayObject(1);
msgQueueInfo = se::Object::createTypedArray(se::Object::TypedArrayType::UINT32, nullptr, sizeof(uint32_t) * 2);
cc::EventDispatcher::addCustomEventListener(EVENT_RESTART_VM, [&](const cc::CustomEvent & /*e*/) {
msgQueuePtrs.clear();
});
{
uint8_t *data{nullptr};
msgArrayBuffer->getArrayBufferData(&data, nullptr);