diff --git a/ETTrace/Tracer/EMGStackTraceRecorder.cpp b/ETTrace/Tracer/EMGStackTraceRecorder.cpp index d00243d..9e726ca 100644 --- a/ETTrace/Tracer/EMGStackTraceRecorder.cpp +++ b/ETTrace/Tracer/EMGStackTraceRecorder.cpp @@ -101,4 +101,7 @@ void EMGStackTraceRecorder::recordStackForAllThreads(bool recordAllThreads, thre size_t endIndex = addressStorage.size(); emplaceResult.first->second.stacks.emplace_back(time, startIndex, endIndex); } + if (recordAllThreads) { + vm_deallocate(mach_task_self(), (vm_address_t) threads, sizeof(thread_t) * threadCount); + } }