Merge pull request #3755 from liamcindy/develop_action

[ci skip]change to use CC_SAFE_RELEASE_NULL and CC_SAFE_RETAIN
This commit is contained in:
minggo 2013-09-23 00:14:43 -07:00
commit 635f394e93
1 changed files with 10 additions and 7 deletions

View File

@ -56,19 +56,18 @@ ActionNode::~ActionNode()
{
if (_action == NULL)
{
CC_SAFE_RELEASE(_actionSpawn);
CC_SAFE_RELEASE_NULL(_actionSpawn);
}
else
{
CC_SAFE_RELEASE(_action);
CC_SAFE_RELEASE_NULL(_action);
}
if (_frameArray != NULL)
{
_frameArray->removeAllObjects();
CC_SAFE_RELEASE(_frameArray);
CC_SAFE_RELEASE_NULL(_frameArray);
}
}
void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root)
@ -300,19 +299,23 @@ Spawn * ActionNode::refreshActionProperty()
}
}
Sequence* cSequence = Sequence::create(cSequenceArray);
if (cSequence != NULL)
{
cSpawnArray->addObject(cSequence);
}
}
if (_action == NULL)
{
CC_SAFE_RELEASE(_actionSpawn);
CC_SAFE_RELEASE_NULL(_actionSpawn);
}
else
{
CC_SAFE_RELEASE(_action);
CC_SAFE_RELEASE_NULL(_action);
}
_actionSpawn = Spawn::create(cSpawnArray);
CC_SAFE_RETAIN(_actionSpawn);
return _actionSpawn;
}