Fix: Hang on shutdown with enabled system tracing
The issue occur when the client wants to shutdown profiling but transfer all data to the server before exiting.
The client code looks like it:
tracy::GetProfiler().RequestShutdown();
while (!tracy::GetProfiler().HasShutdonwFinished())
{
yield...
}
If the client doesn't send any zones/data to the queue, it works fine. But when system tracing is enabled it constantly fills queue with new data, the queue may never become empty, so we never reach exit conditions and the app hangs.
It look like solution to that problem is shutting down system tracing before sending remaining data to the server.
Another possible fix is to check ShouldExit in the systrace callback, but that's appear to me as a waste of cycles.