mirror of https://github.com/axmolengine/axmol.git
d4f65b5348
CCMenu::itemForTouch expects that all children are CCMenuItems. But it is still possible to add other child types, for example if CCAssert is disabled or some other addChild method is called. In this case dynamic_cast to CCNode and later try to do ((CCMenuItem*)pChild)->isEnabled() triggers an undefined behaviour - up to a crash or something else. Fixed by a dynamic_cast straightforward to CCMenuItem. |
||
---|---|---|
.. | ||
CCMenu.cpp | ||
CCMenu.h | ||
CCMenuItem.cpp | ||
CCMenuItem.h |