Fix for issue http://www.cocos2d-x.org/issues/4880.