Projects > cpp > Issues > Bug #356

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

[android] CCLabelTTF::initWithString crashed

Bug #356 [Closed]
walzer@cocos2d-x.org 2011-02-24 22:05 . Updated about 2 years ago

I tried to paste these code at the end of TestController::TestController() constructor, (cocos2d-x/tests/tests/controller.cpp)
or at the start of ActionsDemo::onEnter (ActionTest.cpp)

#if 1
    CCLabelTTF* label2 = new CCLabelTTF();
    if ( label2 && label2->initWithString("aaaaa", "Arial", 32) )
    {
        label2->autorelease();
    }
    else 
    {
        CCX_SAFE_DELETE(label2);
        label2 = NULL;

    }
#else
    CCLabelTTF* label2 = CCLabelTTF::labelWithString("aaaa", "Arial", 32);
#endif  
    if (label2)
    {   
        label2->setPosition( ccp(10, 10) );
        addChild(label2);
    }

It crashed at android, if I new CCLabelTTF object, and call object->initWithString. The odd thing is that, CCLabelTTF::labelWithString works well.
The crashed code works well on win32 & iphone port.

walzer@cocos2d-x.org 2011-03-13 23:43
  • Target version changed from cocos2d-0.99.5-x-0.8.0 to cocos2d-0.99.5-x-0.8.3
zhangbin@cocos2d-x.org 2011-03-14 18:37
  • Status changed from New to Resolved
  • Assignee changed from zhangxm to zhangbin@cocos2d-x.org
  • % Done changed from 0 to 100
zhangbin@cocos2d-x.org 2011-03-14 19:09
  • Status changed from Resolved to Closed
  • Target version changed from cocos2d-0.99.5-x-0.8.3 to cocos2d-0.99.5-x-0.8.0
walzer@cocos2d-x.org 2012-05-25 08:19
  • Project changed from cocos2d-x to cpp
  • Category deleted (2)
  • Target version deleted (cocos2d-0.99.5-x-0.8.0)
agenindonesia 2014-11-25 20:40

Pokerstar88.com Agen Texas Poker Dan Domino Online Indonesia Terpercaya
OK, I’ve updated the announcement and added a link to zipball on google code. Thank you for reminding me.
Agen Indonesia | Agen Bola | Poker Indonesia

ionliga 2014-11-28 14:47

The optimization introduces a bug where the priority and Touch Mode will not get changed if the list is locked.
The most straight forward fix is to merge the pHandlersToAdd and pHandlersToRemove into a queue and process through all of them in the order they are received

Pokerstar88.com Agen Texas Poker dan Domino Online Indonesia Terpercaya | Agen Bola | Taruhan Bola | Agen Bola | Olb365.com Agen Judi Bola Online, Agen Judi Casino Online Indonesia Terpercaya | Jasa SEO | Agen Sbobet

Atom PDF

Status:Closed
Start date:2011-02-24
Priority:Normal
Due date:
Assignee:zhangbin@cocos2d-x.org
% Done:

100%

Category:-
Target version:-

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.