3.0 CCEditBox crashes [Solved]

Output for following peace of code:
cocos2d-x debug info [1]
cocos2d-x debug info [2]
Segmentation fault (core dumped)

CCLOG("1");
CCScale9Sprite* tmp = CCScale9Sprite::createWithSpriteFrame(
  CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("inputText.png"));

CCLOG("2");
playerNameTextBox = CCEditBox::create(CCSize(300, 60), tmp);

CLOG("3");

PS: Working on android or IOS version.

Check if tmp is not null.

tmp != 0

Recompile cocos2dx with make DEBUG=1 and run app in debugger. You can [[QtCreator_project_setup_on_Linux|create QtCreator project]] if you feel yourself uncomfortable with console tools.

In linux? CCEditBox can`t use and run in linux. And will crash.
If u wan`t run it, u can edit CCEditBox.cpp, in this file, var “_editBoxImpl” not check at all. u must check (_editBoxImpl != NULL), it`s a bug when use CCEditBoxImplNone.

Edit CCeditBox.cpp u can run in pro.linux, but can`t use input mothed.

Maybe you should add a CCLOG information, so people will see the cause of the crash…
Will save some hours for sure :wink:

greets & thx

Hi,yang, I got the same error:

cocos2d-x debug info [Ready for GLSL]
cocos2d-x debug info [Ready for OpenGL 2.0]
Segmentation fault (core dumped)

OS:ubuntu linux12.04, coco2d-x version:2.2.1,
The var “*editBoxImpl" wasn’t fund in file CCEditBox.cpp. Now, I wanna debug it in GDB, but it seems hard a little.
imdiot yang wrote:

In linux? CCEditBox can`t use and run in linux. And will crash.
If u wan`t run it, u can edit CCEditBox.cpp, in this file, var "*editBoxImpl” not check at all. u must check (_editBoxImpl != NULL), it`s a bug when use CCEditBoxImplNone.
>
Edit CCeditBox.cpp u can run in pro.linux, but can`t use input mothed.