OK, i have solved the mistery All explains is here: http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Memory\_Management\_in\_Cocos2d-xLine below will fix this issue (inserted on line number 53):
When you do something like this:
spiders = CCArray::arrayWithCapacity(numSpiders);
method arrayWithCapacity automatically put the spiders to autorealease pool. It’s mean that he takes responsibility of release this object (and delete it at the end)
So as soon as possible he will release this object - that’s why we must inform the engine that we will need this spiders later. That’s why we call retain method.
But why in this part:
CCSprite *sprite = CCSprite::spriteWithFile("spider.png");
we don’t need to call retain method? Because of this:
this->addChild(sprite, 0, 2);
addChild will retain object for us.