Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

Cocos-js setTimeout

$
0
0

@insul 写道:

setTimeout的回调函数如果用上bind(this), 会导致这个this无法释放,how to fix?
if (this._loadingTimeout == null || this._loadingTimeout === undefined) {
this._loadingTimeout = setTimeout(function() {
this._loadingTimeout = null;
}.bind(this), 1000);
}

这个形式调用会导致这个this析构不了

帖子: 4

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>