mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Fix simulator crash during app close
This commit is contained in:
@@ -1914,7 +1914,12 @@ bool jsb_remove_proxy(js_proxy_t* proxy)
|
||||
bool jsb_unbind_proxy(js_proxy_t* proxy)
|
||||
{
|
||||
void* nativeKey = proxy->ptr;
|
||||
#if COCOS2D_DEBUG > 1
|
||||
CC_ASSERT(nativeKey && "Invalid nativeKey");
|
||||
#else
|
||||
if (!nativeKey)
|
||||
return false;
|
||||
#endif // COCOS2D_DEBUG
|
||||
|
||||
// delete entry in native proxy map
|
||||
auto it_nat = _native_js_global_map.find(nativeKey);
|
||||
|
||||
@@ -76,7 +76,9 @@ namespace jsb
|
||||
}
|
||||
~Object()
|
||||
{
|
||||
#if COCOS2D_DEBUG > 1
|
||||
CCLOG("Release JSBObject %p, with proxy: %p", this, _proxy);
|
||||
#endif // COCOS2D_DEBUG
|
||||
if (_proxy)
|
||||
{
|
||||
jsb_remove_proxy(_proxy);
|
||||
|
||||
Reference in New Issue
Block a user