Index: runtime/vm/malloc_hooks_tcmalloc.cc |
diff --git a/runtime/vm/malloc_hooks_tcmalloc.cc b/runtime/vm/malloc_hooks_tcmalloc.cc |
index e4a5b86044bd4a18984611e1b095cebef2feae48..e5a1a23e02c73a97c10694afe93ffeab55bc6f75 100644 |
--- a/runtime/vm/malloc_hooks_tcmalloc.cc |
+++ b/runtime/vm/malloc_hooks_tcmalloc.cc |
@@ -143,6 +143,12 @@ class AllocationInfo { |
} |
} |
+ ~AllocationInfo() { |
+ if (sample_ != NULL) { |
+ Profiler::allocation_sample_buffer()->FreeAllocationSample(sample_); |
+ } |
+ } |
+ |
Sample* sample() const { return sample_; } |
intptr_t allocation_size() const { return allocation_size_; } |