Skip to content

Commit

Permalink
Fix memory leak (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahsmartin authored Oct 22, 2024
1 parent 8df984f commit 01e1b0f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ETTrace/Tracer/EMGStackTraceRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 01e1b0f

Please sign in to comment.