Remove RobotLogging from CMakeLists.txt
Avoid crashing if threadIndex exceeds BT_QUICKPROF_MAX_THREAD_COUNT (64)
This commit is contained in:
@@ -518,7 +518,7 @@ CProfileIterator * CProfileManager::Get_Iterator( void )
|
||||
{
|
||||
|
||||
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
||||
if (threadIndex<0)
|
||||
if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT)
|
||||
return 0;
|
||||
|
||||
return new CProfileIterator( &gRoots[threadIndex]);
|
||||
@@ -549,7 +549,7 @@ void CProfileManager::CleanupMemory(void)
|
||||
void CProfileManager::Start_Profile( const char * name )
|
||||
{
|
||||
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
||||
if (threadIndex<0)
|
||||
if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT)
|
||||
return;
|
||||
|
||||
if (name != gCurrentNodes[threadIndex]->Get_Name()) {
|
||||
@@ -566,7 +566,7 @@ void CProfileManager::Start_Profile( const char * name )
|
||||
void CProfileManager::Stop_Profile( void )
|
||||
{
|
||||
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
||||
if (threadIndex<0)
|
||||
if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT)
|
||||
return;
|
||||
|
||||
// Return will indicate whether we should back up to our parent (we may
|
||||
@@ -590,7 +590,7 @@ void CProfileManager::Reset( void )
|
||||
{
|
||||
gProfileClock.reset();
|
||||
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
||||
if (threadIndex<0)
|
||||
if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT)
|
||||
return;
|
||||
gRoots[threadIndex].Reset();
|
||||
gRoots[threadIndex].Call();
|
||||
|
||||
@@ -3,5 +3,5 @@ IF(BUILD_BULLET3)
|
||||
SUBDIRS( InverseDynamics SharedMemory )
|
||||
ENDIF(BUILD_BULLET3)
|
||||
|
||||
SUBDIRS( gtest-1.7.0 collision RobotLogging BulletDynamics )
|
||||
SUBDIRS( gtest-1.7.0 collision BulletDynamics )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user