mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 19:29:47 +02:00
added extra null check on main application close to hopefully fix windows crash
This commit is contained in:
@@ -258,12 +258,11 @@ static void cleanupProcessObjects() {
|
|||||||
if(lastLazyThreadDump != (int)difftime((long int)time(NULL),elapsed)) {
|
if(lastLazyThreadDump != (int)difftime((long int)time(NULL),elapsed)) {
|
||||||
lastLazyThreadDump = difftime((long int)time(NULL),elapsed);
|
lastLazyThreadDump = difftime((long int)time(NULL),elapsed);
|
||||||
|
|
||||||
std::vector<Thread *> threadList = Thread::getThreadList();
|
printf("Waiting for the following threads to exit [" MG_SIZE_T_SPECIFIER "]:\n",Thread::getThreadList().size());
|
||||||
printf("Waiting for the following threads to exit [" MG_SIZE_T_SPECIFIER "]:\n",threadList.size());
|
|
||||||
|
|
||||||
for(int i = 0; i < threadList.size(); ++i) {
|
for(int i = 0; i < Thread::getThreadList().size(); ++i) {
|
||||||
BaseThread *baseThread = dynamic_cast<BaseThread *>(threadList[i]);
|
BaseThread *baseThread = dynamic_cast<BaseThread *>(Thread::getThreadList()[i]);
|
||||||
printf("Thread index: %d isBaseThread: %d, Name: [%s]\n",i,(baseThread != NULL),baseThread->getUniqueID().c_str());
|
printf("Thread index: %d isBaseThread: %d, Name: [%s]\n",i,(baseThread != NULL),(baseThread != NULL ? baseThread->getUniqueID().c_str() : "<na>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user