Bug of jsb when doing removeFromParent() process in onExit() functions!

I create a ‘CCLayer’ and add it to ‘CCScene’(Root Node) at ‘CCScene.onEnter()’ functions in js.
And I call ‘CCLayer.removeFromParent()’ at ‘CCScene.onExit()’ function in js.
But I fond that ‘CCLayer.onExit()’ function is not called in native code when calling ‘CCLayer.removeFromParent()’ function in js.
I check the native code and that find ‘m_bRunning’ parameter of CCScene was set to false when ‘CCScene.onExit()’ called in native code.
Below is the native code ‘onExit()’ Function and how the bug occur.
—————-
this->pauseSchedulerAndActions();
m_bRunning = false; // 1.m_bRunning parameter is set to false
if ( m_eScriptType != kScriptTypeNone)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()>executeNodeEvent;
// 2.CCLayer call removeFromParent
// his parent’s m_bRunning parameter was set to false and onExit function will not call.
// but he removed from his parent
}
arrayMakeObjectsPerformSelector; // 3. there was no CCLayer and his onExit function will never call
—————

I think this is a bug of jsb!

Yep, I think it’s a bug of JSB. I will fix it. Thanks for your feedback.

I encounter a problem in JSB below,may be that is the same problem?

I add a layer to scene, and add a tableView to the layer.
When I remove the layer(using layer->getParent()->removeAllChilden()) in the delegate callback (named “tableCellTouched”), the app crash in C++ “ScrollView::onTouchEnded”(the scrollview was already released).
But it works in cocos2dx 2.2x