How can I do with CCMutableArray<CCSpriteFrame*> and CCAnimation *animationWait = CCAnimation::animationWithFrames

When I want to init animation, I use this code:
CCTexture2D *texture = CCTextureCache::sharedTextureCache~~>addImage;
CCSpriteFrame frame0 = CCSpriteFrame::frameWithTexture);
CCSpriteFrame
frame1 = CCSpriteFrame::frameWithTexture);
CCSpriteFrame frame2 = CCSpriteFrame::frameWithTexture);
CCSpriteFrame
frame3 = CCSpriteFrame::frameWithTexture);
CCSpriteFrame frame4 = CCSpriteFrame::frameWithTexture);
CCSpriteFrame
frame5 = CCSpriteFrame::frameWithTexture);
CCSpriteFrame frame6 = CCSpriteFrame::frameWithTexture);
CCSpriteFrame
frame7 = CCSpriteFrame::frameWithTexture);
CCSprite* spZhadananim = CCSprite::spriteWithSpriteFrame;
spZhadananim~~>setPosition);
addChild;
CCMutableArray<CCSpriteFrame
>*animZhadanWaitFrames = new CCMutableArray<CCSpriteFrame>(4);
animZhadanWaitFrames~~>addObject;
animZhadanWaitFrames~~>addObject(frame5);
animZhadanWaitFrames~~>addObject;
animZhadanWaitFrames~~>addObject(frame7);

CCMutableArray<CCSpriteFrame*> animZhadanExciteFrames = new CCMutableArray<CCSpriteFrame>;
animZhadanExciteFrames~~>addObject;
animZhadanExciteFrames~~>addObject;
animZhadanExciteFrames~~>addObject;
animZhadanExciteFrames~~>addObject;
CCAnimation
*animationWait = CCAnimation::animationWithFrames(animZhadanWaitFrames, 0.1f);
CCAnimate animateWait = CCAnimate::actionWithAnimation;
CCAnimation
animationExcit = CCAnimation::animationWithFrames(animZhadanExciteFrames, 0.2f);
CCAnimate animateExcit = CCAnimate::actionWithAnimation;
CCCallFunc
animOverCallBack = CCCallFunc::actionWithTarget(this, callfunc_selector(SingleFightLayer::animBombsOverCallBack));
spZhadananim~~>runAction,
//CCDelayTime::actionWithDuration,
CCRepeat::actionWithAction,
animOverCallBack,
NULL
));
animZhadanWaitFrames~~>release();
animZhadanExciteFrames->release();
return true;

But there is a problem, I can compile it, but when I run it, I meet an exception
CCAnimation *animationWait = CCAnimation::animationWithFrames(animZhadanWaitFrames, 0.1f);
Can’t init the animation

beatme.win32.exe 中的 0x5a138040 处有未经处理的异常: 0xC0000005: 写入位置 0xfdfdfe09 时发生访问冲突

Who can Help me?? Thank you!

Which line is raising the exception?
Just a guess, does images/bang.png exist (check path and case)?

I suggest that you can trace into the crash line, exactly find out which pointer is wild in the program.

I have solved the problem.
Thank you very much. :wink: