Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuguohua committed Feb 8, 2025
1 parent 8df655d commit 83ec2fe
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions native/cocos/bindings/jswrapper/jsvm/ScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,31 +352,25 @@ void ScriptEngine::cleanup() {

SE_LOGD("ScriptEngine::cleanup begin ...\n");
_isInCleanup = true;

//cc::events::ScriptEngine::broadcast(cc::ScriptEngineEvent::BEFORE_CLEANUP);

do{
se::AutoHandleScope hs;
se::AutoHandleScope hs;
do{
for (const auto &hook : _beforeCleanupHookArray) {
hook();
}
_beforeCleanupHookArray.clear();
}while (0);

_beforeCleanupHookArray.clear();

SAFE_DEC_REF(_globalObj);
Object::cleanup();
Class::cleanup();

garbageCollect();

__oldConsoleLog.setUndefined();
__oldConsoleDebug.setUndefined();
__oldConsoleInfo.setUndefined();
__oldConsoleWarn.setUndefined();
__oldConsoleError.setUndefined();
__oldConsoleAssert.setUndefined();
garbageCollect();


_globalObj = nullptr;
_isValid = false;
Expand Down

0 comments on commit 83ec2fe

Please sign in to comment.