Hi,
I just update to 0.12.0 and I found there is an assert happened to my CCSpawn().
Here is the sample code to reproduce and it’s fine at 0.11.0 !
CCAnimation* openAnimation = CCAnimation::animation();
openAnimation~~>setDelay;
openAnimation~~>addFrame(CCSpriteFrameCache::sharedSpriteFrameCache()>spriteFrameByName);>addFrame(CCSpriteFrameCache::sharedSpriteFrameCache()
openAnimation>spriteFrameByName);>addFrame(CCSpriteFrameCache::sharedSpriteFrameCache()
openAnimation>spriteFrameByName);>runAction(CCSequence::actions(
this
CCSpawn::actions(CCAnimate::actionWithAnimation(openAnimation, true),
CCScaleTo::actionWithDuration(0.3f, 1.1f)),
CCCallFuncN::actionWithTarget(this, callfuncN_selector(BoxSprite::afterTouch)),
NULL));
The assert will occurred at CCObject.cpp
void CCObject::retain(void)
{
CCAssert(m_uReference > 0, “reference count should greater than 0”);
++m_uReference;
}
I use a work-around to get it worked by splitting the CCSpawn into two actions.
this~~>runAction);
this~~>runAction(CCSequence::actions( CCScaleTo::actionWithDuration(0.3f, 1.1f),
CCCallFuncN::actionWithTarget(this, callfuncN_selector(BoxSprite::afterTouch)),
NULL));
If it’s my fault to use CCSpawn with wrong steps, please let me know.
Thank you.