animFrames->release();
this sentence release the frames and its reference count will be 0, you should release it after return or use “autorelease” before return
Em….I comment out the animation~~>release; the ASSERT failure problem still occurs;
And then I replace the animation~~>release(); to animation->autorelease() the ASSERT failure still occurs.
Your debugger should provide you with a callstack. It will stop in some assembly code (thats most certainly the assert calling abort() in the C-library)
But you should be able to see the call stack on where the release call came from.
If you can test your project on linux, I would recommend using valgrind to profile your code, as it will show you where and when the object has been released before.
I think maybe “CCAnimation * animation=new CCAnimation();” this sentence was the problem.
try “animation->autorelease()” or “CCAnimation * animation= CCAnimation::createWithSpriteFrames(…)” (createWithSpriteFrames will call “autorelease” method)
it looks that “animation” was released after call.