我有一个codenameOne应用程序在Android上运行良好,但偶尔会在iOS上崩溃。
从xcode看起来它失败了:
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;
}
}
}
在nativeMethods.m中。它说在那个if语句中threadsToDelete为null。这似乎发生在我打开一个显示图片的新表单,然后切换回原始表单时。我开始一个新的线程,以保存亚马逊的某些细节。但它并不是每次都会崩溃。