The member variable animation~~>m_nameStr & animation~~>pobFrames are valid after invoking CCAnimation::animationWithName. But after the declaration of char frameName[100], animation~~>m_nameStr is overwritten; and then, after sprintf, animation~~>m_pobFrames is written to a wild pointer, too. That’s why program crashes here.
I tried 2 methods
# use char* pszFrameName = new char[ 100 ], to avoid stack overflow
# invoke animation~~>addFrameWithFileName directly
But it didn’t save the program, animation~~>m_pobFrames is overwritten all the same.
Then I watch the variable via gdb, try to catch who changes this address, but the programe hangs
As I said, it is very very odd.
So my suggestion is: don’t invoke this interface in other thread, just do it in the UI mainloop.