pauseSchedulerAndActions immediately after runAction does not work (cocos2d-x 2.1.5)

I have a sprite that I add to a scene and apply an animation to with runAction.

When transitioning from another scene to this scene I want to pause all running actions so that no animation starts until the transition completes.

I recursively call pauseSchedulerAndActions() on all children within the scene after all children have been added to the scene.

Effectively I am doing:
sprite->runAction(action);
sprite->pauseSchedulerAndActions();

However, no actions within the scene are paused. If I call pauseSchedulerAndActions() in the next frame they do get paused. So it seems you can not pauseSchedulerAndActions within the same game loop as you runAction. Which seems to be the incorrect behaviour.

Is there a way for me to “flush” the actions/schedules so that pauseSchedulerAndActions will work as expected?

Thanks

I noticed the same issue. Resolved it with:

	button->scheduleOnce([button](float)
	{
		nodehelper::set(button).pauserescursivaly();
	}, 0, "pauseanim");

(the nodehelper is my own helper class).