我正在使用cocos2dx v3.9和ndk 10e与android 4.4.2。我创建了一个图层,并且该按钮存在。按下按钮时,将从父项中删除图层并执行清理并执行其他任务。按下按钮时出现崩溃,大部分是在按钮出现时轻敲。 点击按钮上的代码是: -
CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("tap.wav");
unschedule(schedule_selector(InstructionLayer::callNextButtonMethod));
if (this->delegate != NULL) {
delegate->clickNextButton();
} else {
CCLOG("Delegate null");
}
this->removeFromParentAndCleanup(true);
}
我的ndk崩溃转储是: -
********** Crash dump: **********
Build fingerprint: 'iNet/astar_ibt_8723bs/astar-ibt-8723bs:4.4.2/KVT49L/20140925:eng/test-keys'
pid: 14096, tid: 14115, name: Thread-1145 >>> com.Sample.Test <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 6d12a000
Stack frame #00 pc 00022090 /system/lib/libc.so (__memcpy_base+176)
Stack frame #01 pc 00a57f29 /data/app-lib/com.Sample.Test-2/libcocos2dcpp.so: Routine unaligned_load at /s/ndk-toolchain/src/gcc/gcc-4.9/libstdc++-v3/libsupc++/hash_bytes.cc:43
Stack frame #02 pc 00424da8 /data/app-lib/com.Sample.Test-2/libcocos2dcpp.so (std::_Hash_impl::hash(void const*, unsigned int, unsigned int)+36): Routine std::_Hash_impl::hash(void const*, unsigned int, unsigned int) at /ShobhitPC/ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/functional_hash.h:131
Stack frame #03 pc 00424df8 /data/app-lib/com.Sample.Test-2/libcocos2dcpp.so (std::hash<std::string>::operator()(std::string const&) const+56): Routine std::hash<std::string>::operator()(std::string const&) const at /ShobhitPC/ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:3084 (discriminator 2)