Fix allocation tracker leaks.
authorsvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 6 Feb 2014 07:10:59 +0000 (07:10 +0000)
committersvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 6 Feb 2014 07:10:59 +0000 (07:10 +0000)
R=yangguo@chromium.org, yurys@chromium.org

Review URL: https://codereview.chromium.org/155513004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19127 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/allocation-tracker.cc

index 59ba6c9..5ec6484 100644 (file)
@@ -46,6 +46,7 @@ AllocationTraceNode::AllocationTraceNode(
 
 
 AllocationTraceNode::~AllocationTraceNode() {
+  for (int i = 0; i < children_.length(); i++) delete children_[i];
 }
 
 
@@ -155,6 +156,11 @@ AllocationTracker::AllocationTracker(
 
 AllocationTracker::~AllocationTracker() {
   unresolved_locations_.Iterate(DeleteUnresolvedLocation);
+  for (HashMap::Entry* p = id_to_function_info_.Start();
+       p != NULL;
+       p = id_to_function_info_.Next(p)) {
+    delete reinterpret_cast<AllocationTracker::FunctionInfo* >(p->value);
+  }
 }