CCScheduler issue

CCScheduler issue
0.0 0


at CCScheduler.cpp line number 823,
has a comment:“// The ‘timers’ array may change while inside this loop”,
I found the timers was NULL sometimes , but I don’t know why ? and why not fix it by :


for (elt~~>timerIndex = 0; elt~~>timerIndex < elt~~>timers~~>num; ++(elt->timerIndex))


for (elt~~>timerIndex = 0; elt~~>timers && elt~~>timerIndex < elt~~>timers->num; ++(elt->timerIndex))



Same issue here… kept crashing on Release Build. I added another condition. Hope this can be more stable.

Version: cocos2d-x-2.2 C++


for (elt->timerIndex = 0; elt->timerIndex < elt->timers->num; ++(elt->timerIndex))


for (elt->timerIndex = 0; elt && elt->timers && elt->timerIndex < elt->timers->num; ++(elt->timerIndex))


These posts are easier to deal with if a version ID or GIT link is provided.