cocos2d/cocos2d-x — pull request #1485 by mingulov (2012-10-21 08:23:14+00:00)
Title: CCMenu - prevent a crash if some child item is not CCMenuItem

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.