升级creator1.2.2到1.4.0后web上没问题,android平台上时不时崩溃!

backtrace:
0 [55]</Layout<._updateChildrenEventListener/<(child = [object Node], null) [“assets/src/jsb_polyfill.js” 8881:20]
1 Function.prototype.bind/fBound(arguments = [object Node], null) [“G:\friend_table\platform\build\jsb-default\frameworks\runtime-src\proj.android\assets\script\jsb_boot.js” 1792:0

backtrace:
0 equalsToDefault(def = , value = ) [“assets/src/jsb_polyfill.js” 19236:55]
1 [119]</<.enumerateCCClass(codeArray = var o;,if®{,o=R;,}else{,o=R=new cc.Node();,},o._name=“RoomPlayerInfoPanel”;,o._contentSize=new cc.Size(1280,720);, obj = [object Object], klass = [function]) [“assets/src/jsb_polyfill.js” 19312:28]
2 [119]</<.enumerateObject(codeArray = var o;,if®{,o=R;,}else{,o=R=new cc.Node();,},o._name=“RoomPlayerInfoPanel”;,o._contentSize=new cc.Size(1280,720);, obj = [object Object]) [“assets/src/jsb_polyfill.js” 19378:20]
3 Parser(obj = [object Object], parent = [object Object]) [“assets/src/jsb_polyfill.js” 19266:12]
4 compile(node = [object Object]) [“assets/src/jsb_polyfill.js” 19443:25]
5 [30]</Prefab<.compileCreateFunction() [“assets/src/jsb_polyfill.js” 5962:39]
6 [30]</Prefab<._doInstantiate() [“assets/src/jsb_polyfill.js” 5966:0]
7 [30]</Prefab<._instantiate() [“assets/src/jsb_polyfill.js” 5970:27]
8 instantiate(original = [object Object]) [“assets/src/jsb_polyfill.js” 19477:28]
9 l

贴一下你的 bind 函数使用,尽量避免 bind 函数的使用

    EventCustom.on('EVENT_CANNOT_RECEIVE_BRAND_REWARD', function () {
        this.showRewardFail();
    }.bind(this), this.node);

大神bind用的比较多,不好去掉啊!在web上都正常。

    if( typeof C.HotUpdate !== 'undefined' && C.HotUpdate === false ){
        this.setTimeout(this.UpdateSuccess.bind(this),0);
        return;
    }

EventCustom.on(‘EVENT_CANNOT_RECEIVE_BRAND_REWARD’, function () {
this.showRewardFail();
}.bind(this), this.node);

EventCustom.on('EVENT_CANNOT_RECEIVE_BRAND_REWARD', function () {
        this.showRewardFail();
    }, this);

这样就可以了啊,我也不懂你们为什么非要用 bind,on 的第三个参数就是 target 啊,你传一个 this.node 然后还要把 this bind 上去,完全没意义啊

setTimeout 可以这样写

if( typeof C.HotUpdate !== 'undefined' && C.HotUpdate === false ){
    var self = this;
    this.setTimeout(function () {
        self.UpdateSuccess();
    },0);
    return;
}

可以先定位是不是 bind 导致的

1赞

也可以尝试从 native 引擎的 cocos/scripting/js-bindings/script/jsb_boot.js 中直接删除 Function.prototype.bind 实现

已经测试过册除过这个函数!还是会是不是崩溃,1.4.2版本有没有解决一些奔溃问题!问下大神,以前1.2.2版本的cc.eventmanger作为全局自定义的消息监听与分发没用了,现在使用的是cc.eventtarget作。你有好的建议做全局消息监听与分发吗?