clarification

This commit is contained in:
Marcos Slomp
2025-12-03 12:41:44 -08:00
parent 874d65b036
commit 7fa30d08b5

View File

@@ -2148,9 +2148,15 @@ void Profiler::Worker()
while( s_symbolThreadGone.load() == false ) { YieldThread(); }
#endif
// Client is exiting.
#ifdef TRACY_HAS_SYSTEM_TRACING
// Stop filling queues with new data.
// On a typical shutdown scenario, the (global) Profiler object is destroyed by
// the C++ runtime when the client program returns from "main", and ~Profiler()
// takes care of calling StopSystemTracing(). However, a client may decide to
// manually RequestShutdown(), in which case ~Profile() may not execute before
// this Worker() thread goes through its teardown stages and reaches this point.
// To ensure that system tracing does not keep pushing data to the worker queue
// indefinitely (thus preventing this worker from terminating), we have to call
// StopSystemTracing() here as well to be safe:
StopSystemTracing();
#endif