cocos2dx 3.16 ios 双击home键后退出游戏报错

新建一个test项目,用xcode打包,调试,项目能够正常跑起来,在双击home后从后台强制退出,会报错,报错的内容为
ScriptingCore::removeAllRoots(JSContext *cx)方法里的 _native_js_global_map.clear();
发现是这个unordered_map 类型调用clear方法出错,log如下:
{
gl.supports_OES_map_buffer: true
gl.supports_vertex_array_object: true
cocos2d.x.version: cocos2d-x-3.16
gl.vendor: Apple Inc.
gl.supports_PVRTC: true
gl.renderer: Apple Software Renderer
cocos2d.x.compiled_with_profiler: false
gl.supports_S3TC: false
gl.version: OpenGL ES 2.0 APPLE-14.0.15
cocos2d.x.build_type: DEBUG
gl.max_texture_size: 4096
gl.supports_ETC1: false
gl.supports_BGRA8888: false
gl.max_texture_units: 8
gl.max_samples_allowed: 4
gl.supports_OES_packed_depth_stencil: true
gl.supports_ATITC: false
gl.supports_NPOT: true
gl.supports_discard_framebuffer: true
cocos2d.x.compiled_with_gl_state_cache: true
gl.supports_OES_depth24: true
}

cocos2d: fullPathForFilename: No file found at script/jsb_prepare.jsc. Possible missing file.
cocos2d: fullPathForFilename: No file found at script/jsb_boot.jsc. Possible missing file.
Cocos2d-JS v3.16
2017-11-13 14:24:37.467 testapp-mobile[10114:56465] cocos2d: surface size: 1136x640
libpng warning: iCCP: known incorrect sRGB profile
cocos2d: QuadCommand: resizing index size from [-1] to [2560]
2017-11-13 14:24:37.687 testapp-mobile[10114:56465] cocos2d: surface size: 1136x640
testapp-mobile(10114,0x1167903c0) malloc: *** error for object 0x608000226ac0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

非常头疼,新建的test项目啥也没有修改,路过的大大们有碰到过这个问题吗?

插着调试的时候 退出 XCODE不都是会报错吗?

这…接了腾讯的bugly,这个报错太频繁了,直接影响boss的体验。

一直有这个问题存在。

哈哈,居然没人站出来喷你还在用cocos2d-js.

这个bug老早就修复了, 不过只修复了cocos2d-x-lite, 也就是creator这个亲儿子才行, 不然你只有像我一样手动移植代码咯.
最后修复pr在此 https://github.com/cocos-creator/cocos2d-x-lite/pull/762

哈哈,为啥要喷。
刚才看了下,的确是解决了,但是不是很好移植,我再看看
感谢你

由于lite下面的jsb文件和cocos2dx-js下的jsb文件有很多不一样,没有修改,只是把ios下的AppController.mm文件按照上面修改了,发现退出没有闪退。目前没有发现其他问题。:yum::yum:

:joy:不知道 反正我被喷了几次了