Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed component don't off all eventListen when node destroy

Merged
merged 1 commit into from Dec 30, 2019
Merged

fixed component don't off all eventListen when node destroy #5985

merged 1 commit into from Dec 30, 2019

Conversation

zhefengzhang
Copy link
Contributor

@zhefengzhang zhefengzhang commented Dec 27, 2019

Re: https://forum.cocos.org/t/-onpredestroy-target-targetoff-this-bug/87616

由于每次循环时,如果条件满足的话,eventTargets 数组都会剔除一个元素,所以如果使用原来增量遍历的方法会导致 eventTargets[i] 访问不到正确的元素。

这是出现异常时,chrome 的调试信息:
WX20191227-163323@2x

@holycanvas
Copy link
Contributor

holycanvas commented Dec 30, 2019

尴尬,这个问题现在才暴露出来么

@holycanvas holycanvas merged commit 801d02f into cocos:v2.3.0 Dec 30, 2019
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants