fix thread index going out of range bug

This commit is contained in:
Lunkhound
2017-06-03 04:16:57 -07:00
parent 861766f1d5
commit 0fc3ce69e9
3 changed files with 461 additions and 261 deletions

View File

@@ -14,7 +14,7 @@
// Ogre (www.ogre3d.org).
#include "btQuickprof.h"
#include "btThreads.h"
@@ -685,6 +685,9 @@ void CProfileManager::dumpAll()
unsigned int btQuickprofGetCurrentThreadIndex2()
{
#if BT_THREADSAFE
return btGetCurrentThreadIndex();
#else // #if BT_THREADSAFE
const unsigned int kNullIndex = ~0U;
#ifdef _WIN32
#if defined(__MINGW32__) || defined(__MINGW64__)
@@ -717,6 +720,7 @@ unsigned int btQuickprofGetCurrentThreadIndex2()
sThreadIndex = gThreadCounter++;
}
return sThreadIndex;
#endif // #else // #if BT_THREADSAFE
}
void btEnterProfileZoneDefault(const char* name)