Hi,
It’s a little difficult to explain, but I’m going to try it.
- I’m using cocos2d-x 2.0 to update a needle in a speedometer, the data comes from a server and the rate of packets arrive is undefined, probably more than 100 per second.
- I’m capturing the packages from network and each time I’ve a new data, this must to be refreshed in my GUI. For that I send a notification to every component in my GUI, exactly like this:
*CCNotificationCenter::sharedNotifCenter()~~>postNotification;* - Every component in my GUI has an infoUpdate method that is called each time a notification arrives
- The needle speedometer update it’s rotation depending of the speed.
Ok, until here it’s very simple.
The problems is a SIGNAL 11 Segmentation in Android and a EXEC BAD ACCESS in iOS exactly in this point in the class CCActionManager::update
void CCActionManager::update
{
for
{
m_pCurrentTarget = elt;
m_bCurrentTargetSalvaged = false;
if
{
// The ‘actions’ CCMutableArray may change while inside this loop.
for <<<—— HERE is the problem
Ok then this is my fix:
for &&&&; m_pCurrentTarget~~>actionIndex++)
Ok.
Now the problem is not here, randomly I found a SIGNAL 11 or BAD ACCESS here:
pid: 13793, tid: 13821, name: Thread-1724 >>> org.cocos2dx.hudrfactor <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000001a
Stack frame #00 pc 001a7818 /data/app-lib/org.cocos2dx.hudrfactor-1/libgame.so (cocos2d::CCActionManager::update(float)+228): Routine update in jni/…/…/…/cocos2dx/actions/CCActionManager.cpp:373
Stack frame #01 pc 001850e0 /data/app-lib/org.cocos2dx.hudrfactor-1/libgame.so (cocos2d::CCScheduler::tick(float)+348): Routine tick in jni/…/…/…/cocos2dx/CCScheduler.cpp:668
Stack frame #02 pc 001bc4d0 /data/app-lib/org.cocos2dx.hudrfactor-1/libgame.so (cocos2d::CCDirector::drawScene()+72): Routine drawScene in jni/…/…/…/cocos2dx/CCDirector.cpp:184
Stack frame #03 pc 001be4b0 /data/app-lib/org.cocos2dx.hudrfactor-1/libgame.so (cocos2d::CCDisplayLinkDirector::mainLoop()+92): Routine mainLoop in jni/…/…/…/cocos2dx/CCDirector.cpp:935
Stack frame #04 pc 002036d4 /data/app-lib/org.cocos2dx.hudrfactor-1/libgame.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender+40): Routine Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender in jni/…/…/…/cocos2dx/platform/android/jni/MessageJni.cpp:51
Stack frame #05 pc 0001e290 /system/lib/libdvm.so (dvmPlatformInvoke+112)
Stack frame #06 pc 0004d411 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const**, JValue**, Method const**, Thread**)+396)
Stack frame #07 pc 00000214 /dev/ashmem/dalvik-jit-code-cache (deleted)
This trace is from coco2d 1.0, not coco2d 2.0, but the problem is exactly the same.
Is there anything I can do?, is a problem in CCActionManager maybe?
Kind Regads,