mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Fix TRACY_NO_EXIT behavior.
Terminate event could be the first event that was sent. In such case server immediately closed the connection, as there was no outstanding data to receive. Fix by sending all data in the queue before sending terminate event.
This commit is contained in:
parent
1cb12f74c4
commit
7300c2e46e
@ -230,6 +230,25 @@ void Profiler::Worker()
|
||||
if( ShouldExit() ) break;
|
||||
}
|
||||
|
||||
for(;;)
|
||||
{
|
||||
const auto status = Dequeue( token );
|
||||
if( status == ConnectionLost )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if( status == QueueEmpty )
|
||||
{
|
||||
if( m_bufferOffset != m_bufferStart ) CommitData();
|
||||
break;
|
||||
}
|
||||
|
||||
while( m_sock->HasData() )
|
||||
{
|
||||
if( !HandleServerQuery() ) break;
|
||||
}
|
||||
}
|
||||
|
||||
QueueItem terminate;
|
||||
terminate.hdr.type = QueueType::Terminate;
|
||||
if( !SendData( (const char*)&terminate, 1 ) ) return;
|
||||
|
Loading…
Reference in New Issue
Block a user