File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2148,9 +2148,15 @@ void Profiler::Worker()
21482148 while ( s_symbolThreadGone.load () == false ) { YieldThread (); }
21492149#endif
21502150
2151- // Client is exiting.
21522151#ifdef TRACY_HAS_SYSTEM_TRACING
2153- // Stop filling queues with new data.
2152+ // On a typical shutdown scenario, the (global) Profiler object is destroyed by
2153+ // the C++ runtime when the client program returns from "main", and ~Profiler()
2154+ // takes care of calling StopSystemTracing(). However, a client may decide to
2155+ // manually RequestShutdown(), in which case ~Profile() may not execute before
2156+ // this Worker() thread goes through its teardown stages and reaches this point.
2157+ // To ensure that system tracing does not keep pushing data to the worker queue
2158+ // indefinitely (thus preventing this worker from terminating), we have to call
2159+ // StopSystemTracing() here as well to be safe:
21542160 StopSystemTracing ();
21552161#endif
21562162
You can’t perform that action at this time.
0 commit comments