Reviewers: yurys, alph, loislo, Yang,

Message:
I'm not 100% sure if these fixes are the right way to do it, but I'm quite sure that we leak AllocationTraceNodes and FunctionInfos otherwise. At least I can't
figure out how/where they would be magically cleaned up without this CL.

Description:
Fix allocation tracker leaks.

Please review this at https://codereview.chromium.org/155513004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+6, -0 lines):
  M src/allocation-tracker.cc


Index: src/allocation-tracker.cc
diff --git a/src/allocation-tracker.cc b/src/allocation-tracker.cc
index 59ba6c99a67241345f02e84032326dec7ddea1da..5ec64846015ec7d19d011e3125ada144da27d40a 100644
--- a/src/allocation-tracker.cc
+++ b/src/allocation-tracker.cc
@@ -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);
+  }
 }




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to