gamelab / kiwi.js

Kiwi.js is a blazingly fast mobile & desktop browser based HTML5 game framework. It uses CocoonJS for publishing to the AppStore.
www.kiwijs.org
MIT License
1.41k stars 194 forks source link

update() hold reference to member #295

Open fixermark opened 6 years ago

fixermark commented 6 years ago

Hold reference to member in members array while acting on it. This avoids a buggy corner-case where members[i].update() could change the number of members in this Group, resulting in the members[i].exists check referencing a different member (and possibly crashing on members[i] being undefined).