diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index e3da7563..b37950e2 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1207,14 +1207,6 @@ Profiler::Profiler() void Profiler::SpawnWorkerThreads() { - s_thread = (Thread*)tracy_malloc( sizeof( Thread ) ); - new(s_thread) Thread( LaunchWorker, this ); - -#ifndef TRACY_NO_FRAME_IMAGE - s_compressThread = (Thread*)tracy_malloc( sizeof( Thread ) ); - new(s_compressThread) Thread( LaunchCompressWorker, this ); -#endif - #ifdef TRACY_HAS_SYSTEM_TRACING if( SysTraceStart( m_samplingPeriod ) ) { @@ -1224,6 +1216,14 @@ void Profiler::SpawnWorkerThreads() } #endif + s_thread = (Thread*)tracy_malloc( sizeof( Thread ) ); + new(s_thread) Thread( LaunchWorker, this ); + +#ifndef TRACY_NO_FRAME_IMAGE + s_compressThread = (Thread*)tracy_malloc( sizeof( Thread ) ); + new(s_compressThread) Thread( LaunchCompressWorker, this ); +#endif + #if defined _WIN32 || defined __CYGWIN__ s_profilerThreadId = GetThreadId( s_thread->Handle() ); AddVectoredExceptionHandler( 1, CrashFilter );