I may have discovered the source of the problem, but not really sure how to properly solve the issue.
Here’s how I init the label:
text = CCLabelBMFont::create( INIT_STRING, FONT_BMFONT, textWidth);
text->setPosition( ccp( textXPosition, boxHeight/2));
text->setColor( ccc3(0, 0, 0));
And then I update it with:
If INIT_STRING is “” (empty string) then there’s a chance that it will crash in resizeCapacity() as CCLabelBMFont is readjusting in setString().
If INIT_STRING is a long string of junk (e.g. “0123456789 0132456789013564 5646”) and as long as that string is longer than the string set in setString(), then the crash never happens because the texture is never adjusted with resizeCapacity(). I think there might be a problem in resizeCapacity(). A similar problem was described with it here: http://cocos2d-x.org/forums/6/topics/36099?r=36144#message-36144