Segfault with CCLayerColor and normal behavior with CCLayer

Hi,
I have some troubles with CCLayerColor. I have a class that works well when inheriting from CCLayer, and causing a Segfault when inheriting from CCLayerColor.

class MyLayer : public CCLayer{

bool MyLayer::init(){

    if(!CCLayer::init())
        return false;

    CCMenuItemImage *item = CCMenuItemImage::create(
                                        "fly/menu/YesButton.png",
                                        "fly/menu/YesButtonHover.png"));
    ...
}

The preceding code works well.

class MyLayer : public CCLayerColor{

bool MyLayer::init(){

    if(!CCLayerColor::init())
        return false;

    CCMenuItemImage *item = CCMenuItemImage::create(
                                        "fly/menu/YesButton.png",
                                        "fly/menu/YesButtonHover.png"));
    ...
}

The preceding code causes me this error:

(gdb) bt
#0  _int_malloc (av=0x3fa09b0720, bytes=) at malloc.c:3603
#1  0x0000003fa067f4b3 in __GI___libc_malloc (bytes=416) at malloc.c:2928
#2  0x0000003fa4a5f58d in operator new (sz=416) at ../../../../libstdc++-v3/libsupc++/new_op.cc:52
#3  0x00007ffff71f978d in cocos2d::CCMenuItemImage::create (normalImage=0x40fbbc "fly/menu/YesButton.png", selectedImage=0x40fba0 "fly/menu/YesButtonHover.png") at ../menu_nodes/CCMenuItem.cpp:760
#4  0x00007ffff71f970c in cocos2d::CCMenuItemImage::create (normalImage=0x40fbbc "fly/menu/YesButton.png", selectedImage=0x40fba0 "fly/menu/YesButtonHover.png") at ../menu_nodes/CCMenuItem.cpp:750
#5  0x000000000040c25e in MyLayer::init (this=0xc793e0) at Mylayer.cpp:25

Do you have a clue to solve this issue ?
Thanks

How do you create instance of that class?

With the default constructor indeed…
But with create(), MyLayer::init() does not seems to be called.

CCLayer* l = MyLayer::create();
l->init();

Do I need to implement MyLayer::create() and make it return a MyLayer object ?

Yes. You can use CREATE_FUNC macro for this.