Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17078

Understanding ActionManager update function

$
0
0

@padmnabh wrote:

Hi,
Can anyone help me understand ActionManager update method I am trying to debug one of severe crash in my iOS application and some ow it usually point's to this method so I just need someone who can help me with the flow call of this method.

Basically I need to understand
void ActionManager::update(float dt)
line +36

// Make currentAction nil to prevent removeAction from salvaging it.
                    _currentTarget->currentAction = nullptr;

line +56

// issue #635
_currentTarget = nullptr;

what are these two lines performing and who all are callers participating in this i.e how can i try and point the _currentTarget in this

Till now I am able to find that
My call on any node's stopAllAction() will invoke removeAllActionsFromTarget(this);

void Node::stopAllActions()
{
_actionManager->removeAllActionsFromTarget(this);
}

which in turn will do some retain() for that node

void ActionManager::removeAllActionsFromTarget(Node *target)

if (ccArrayContainsObject(element->actions, element->currentAction) && (! element->currentActionSalvaged))
{
element->currentAction->retain();
element->currentActionSalvaged = true;
}

and this gets removed on next void ActionManager::update(float dt) call
but i am still somehow confused on call hierarchy as I am now checking every node->getNumberOfRunnignAction > 0 before calling stopAllAction so still is there any chance my call can somehow point to unknown memory location causing a crash or is there something else also invloved in this whole scenario as I am confused now I have a
Director::getInstance()->getRunningScene()->runAction(seq); call and inside this sequence there will be some Node->stopAllAction() do they somehow affect parent or are limited to that Node.

Anything relate to ActionManager::update(float dt) will be helpful.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17078

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>