cocos2d-x小项目切换场景时出现FAILED BINDER TRANSACTION

本人正在练习一个Cocos2d-x小项目,在vs上从菜单界面切换到过渡界面没有问题,但移植到android上后运行出错,程序闪退
出现FAILED BINDER TRANSACTION的错误,以下是eclipse上的以error级别的logCat日志

10-07 22:47:27.950: A/libc(19907): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 19933 (GLThread 22541)
10-07 22:47:28.290: E/Thermal-daemon(2782): temp_new :38 temp_old :37
10-07 22:47:28.290: E/Thermal-daemon(2782): Report temperature: temp :38 report_threshold:1
10-07 22:47:28.360: E/JavaBinder(3311): !!! FAILED BINDER TRANSACTION !!!
10-07 22:47:28.380: E/JavaBinder(3311): !!! FAILED BINDER TRANSACTION !!!
10-07 22:47:28.380: E/SubmitMessage(4950): Submit string: submit:trigger=0,bugtype=12,modulename=org.cocos2dx.hellocpp,level=1,testtype=NORMAL,path=/data/log/unzip/PLK-UL00_PLK-UL00C17B121_W8RDU15625001613_20151007224728_tombstone,mode=1
10-07 22:47:28.390: E/lowmemorykiller(2747): Error writing /proc/19907/oom_score_adj; errno=22
10-07 22:47:28.470: E/JavaBinder(3311): !!! FAILED BINDER TRANSACTION !!!
10-07 22:47:28.470: E/JavaBinder(3311): !!! FAILED BINDER TRANSACTION !!!
10-07 22:47:28.520: E/JavaBinder(3311): !!! FAILED BINDER TRANSACTION !!!
10-07 22:47:28.520: E/JavaBinder(3311): !!! FAILED BINDER TRANSACTION !!!
10-07 22:47:28.570: E/HsmCoreServiceImpl(3311): onTransact in code is: 102
: E/(): Device disconnected

这是点击开始游戏按钮回调的函数:
void MenuLayer::menuCallbackStartGame()
{
if(HaveSound)
SoundUtil::playEffect(soundName);
psm->goToBetween(0,true);
}
这是场景管理类中过渡场景的创建:
void StarSceneManager::goToBetween(int mapNumber,bool isNew)
{
betweenScene = Scene::create();
auto betweenLayer = BetweenMenuAndGameLayer::create();
betweenLayer->mapNumber = mapNumber;
betweenLayer->isNew = isNew;
betweenLayer->initString();
betweenLayer->psm = this;
betweenScene->addChild(betweenLayer);
Director::getInstance()->replaceScene(betweenScene);//切换场景
}
这是过渡类界面的其中几个函数:
void BetweenMenuAndGameLayer::initString()
{
char a;
snprintf(a,5,"%d",mapNumber+1);
std::string strLevel = “level “;
strLevel = strLevel +a;
char winScore;
snprintf(winScore,10,”%d”,mapNumber2000+1000);
auto pLabel1 = Label::createWithTTF(strLevel.c_str(),“fonts/MarKer Felt.ttf”,40);
auto pLabel2 = Label::createWithTTF(“target score is”,“fonts/MarKer Felt.ttf”,40);
auto pLabel3 = Label::createWithTTF(winScore,“fonts/MarKer Felt.ttf”,40);
pLabel1->setColor(Color3B::WHITE);
pLabel2->setColor(Color3B::WHITE);
pLabel3->setColor(Color3B::WHITE);
pLabel1->setPosition(Point(origin.x+580
wRate,origin.y+600hRate));
pLabel2->setPosition(Point(origin.x+600
wRate,origin.y+500hRate));
pLabel3->setPosition(Point(origin.x+580
wRate,origin.y+400hRate));
this->addChild(pLabel1,2);
this->addChild(pLabel2,2);
this->addChild(pLabel3,2);
auto action1 = MoveTo::create(1.0,Point(origin.x+240
wRate,origin.y+600hRate));
auto action2 = MoveTo::create(1.1,Point(origin.x+240
wRate,origin.y+500hRate));
auto action3 = MoveTo::create(1.3,Point(origin.x+240
wRate,origin.y+400hRate));
auto delay = DelayTime::create(3.0);
pLabel1->runAction(action1);
pLabel2->runAction(action2);
pLabel3->runAction(Sequence::create(action3,delay,
CCCallFuncND::create(this,callfuncND_selector(BetweenMenuAndGameLayer::callFuncBetweenLayerOver),
NULL),
NULL));
}
void BetweenMenuAndGameLayer::callFuncBetweenLayerOver(Node
node,void* param)
{
psm->goToGame(mapNumber,isNew);
}

希望有好心人帮助我一下,谢谢!

:我觉得应该是 你 goToBetween 这个函数里面 betweenLayer->psm = this;你让psm指针指向当前这个层。你又没有把它retain一次。切换场景的时候当前的这个层肯定会被release掉,然后psm 就是空指针了。然后切换到你betweenScene这个场景的时候可能把psm添加到节点了啊什么的。然后切换场景失败了吧。
额,猜想应该是这样。你试试吧。

谢谢!昨晚我发了贴后就睡了,我试试看吧!

好像还是没用!