I have a codenameOne app that works fine on Android but occasionally crashes on iOS.
From xcode it looks like its failing at:
JAVA_VOID java_lang_Thread_releaseThreadNativeResources___long(CODENAME_ONE_THREAD_STATE, JAVA_LONG nativeThreadId) {
for(int i = 0 ; i < NUMBER_OF_SUPPORTED_THREADS ; i++) {
if(threadsToDelete[i] != 0 && threadsToDelete[i]->threadId == nativeThreadId) {
free(threadsToDelete[i]->blocks);
free(threadsToDelete[i]->threadObjectStack);
free(threadsToDelete[i]->callStackClass);
free(threadsToDelete[i]->callStackLine);
free(threadsToDelete[i]->callStackMethod);
free(threadsToDelete[i]->pendingHeapAllocations);
free(threadsToDelete[i]);
threadsToDelete[i] = 0;
break;
}
}
}
in nativeMethods.m. It says threadsToDelete is null in that if statement. This seems to happen when I open a new form showing a picture, then switch back to the original form. I do start a new thread to save certain details to amazon. But it doesn't crash everytime.
threadsToDelete
itself 0? Is there a way you can reproduce this with a simple test case?threadsToDelete[i]
== 0 this is fine as that is a valid state tested here. IfthreadsToDelete
is 0 that would be a problem. Can you post the stack trace from xcode?