mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52: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:
@@ -406,9 +406,7 @@ bool register_javascript_objc_bridge(se::Object *obj) {
|
||||
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;
|
||||
//bridgeCxxInstance is an se object which will be deleted in se holder.
|
||||
ScriptNativeBridge::bridgeCxxInstance = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user