mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
destroy JsbBridge in unify way
* make jsbBridge fit v3.6.0 restart logic, clean up jsbBridges * Add nil judgement and release operation
This commit is contained in:
@@ -683,10 +683,8 @@ bool register_javascript_java_bridge(se::Object *obj) { //NOLINT(readability-ide
|
||||
|
||||
se::Class *__jsb_ScriptNativeBridge_class = nullptr; // NOLINT
|
||||
|
||||
static bool ScriptNativeBridge_finalize(se::State &s) { //NOLINT(readability-identifier-naming)
|
||||
auto *cobj = static_cast<ScriptNativeBridge *>(s.nativeThisObject());
|
||||
CC_ASSERT(cobj == ScriptNativeBridge::bridgeCxxInstance);
|
||||
delete cobj;
|
||||
static bool ScriptNativeBridge_finalize(se::State &s) { //NOLINT
|
||||
//bridgeCxxInstance is an se object which will be deleted in se holder.
|
||||
ScriptNativeBridge::bridgeCxxInstance = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user