Revert "fix memory leak (#10804)" (#10823)

This reverts commit 3374c7e41c.
This commit is contained in:
minggo
2022-04-21 13:52:20 +08:00
committed by GitHub
parent 54179afa4c
commit cb1234b63a
23 changed files with 68 additions and 214 deletions
+6 -8
View File
@@ -27,8 +27,7 @@
#include "platform/interfaces/OSInterface.h"
extern int cocos_main(int argc, const char **argv); // NOLINT(readability-identifier-naming)
extern void cocos_close(); // NOLINT(readability-identifier-naming)
extern int cocos_main(int argc, const char** argv); // NOLINT(readability-identifier-naming)
extern void cocos_destory(); // NOLINT(readability-identifier-naming)
namespace cc {
@@ -36,7 +35,7 @@ UniversalPlatform::OSType UniversalPlatform::getOSType() const {
return getInterface<ISystem>()->getOSType();
}
void UniversalPlatform::dispatchEvent(const OSEvent &ev) {
void UniversalPlatform::dispatchEvent(const OSEvent& ev) {
bool isHandled = false;
if (_handleEventCallback) {
isHandled = (_handleEventCallback)(ev);
@@ -52,10 +51,10 @@ void UniversalPlatform::dispatchEvent(const OSEvent &ev) {
}
}
void UniversalPlatform::dispatchTouchEvent(const OSEvent &ev) {
void UniversalPlatform::dispatchTouchEvent(const OSEvent& ev) {
}
void UniversalPlatform::handleDefaultEvent(const OSEvent &ev) {
void UniversalPlatform::handleDefaultEvent(const OSEvent& ev) {
// TODO(cc) : Follow-up support
}
@@ -67,7 +66,7 @@ void UniversalPlatform::setHandleDefaultEventCallback(HandleEventCallback cb) {
_handleDefaultEventCallback = cb;
}
int32_t UniversalPlatform::run(int argc, const char **argv) {
int32_t UniversalPlatform::run(int argc, const char** argv) {
if (cocos_main(argc, argv) != 0) {
return -1;
}
@@ -78,7 +77,7 @@ int UniversalPlatform::getSdkVersion() const {
return 0;
}
void UniversalPlatform::runInPlatformThread(const ThreadCallback &task) {
void UniversalPlatform::runInPlatformThread(const ThreadCallback& task) {
_mainTask = task;
}
@@ -106,7 +105,6 @@ void UniversalPlatform::onResume() {
}
void UniversalPlatform::onClose() {
cocos_close();
}
void UniversalPlatform::onDestory() {