fix crash if a thread is started before LOG
This commit is contained in:
@@ -220,6 +220,7 @@ void RageThread::Create( int (*fn)(void *), void *data )
|
|||||||
|
|
||||||
if( name == "" )
|
if( name == "" )
|
||||||
{
|
{
|
||||||
|
if( LOG )
|
||||||
LOG->Warn("Created a thread without naming it first.");
|
LOG->Warn("Created a thread without naming it first.");
|
||||||
|
|
||||||
/* If you don't name it, I will: */
|
/* If you don't name it, I will: */
|
||||||
@@ -228,6 +229,7 @@ void RageThread::Create( int (*fn)(void *), void *data )
|
|||||||
strcpy( m_pSlot->name, name.c_str() );
|
strcpy( m_pSlot->name, name.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( LOG )
|
||||||
LOG->Trace( "Starting thread: %s", name.c_str() );
|
LOG->Trace( "Starting thread: %s", name.c_str() );
|
||||||
sprintf( m_pSlot->ThreadFormattedOutput, "Thread: %s", name.c_str() );
|
sprintf( m_pSlot->ThreadFormattedOutput, "Thread: %s", name.c_str() );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user