Skip to content

Commit

Permalink
Fix a couple of cpu profile memory leaks (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Oct 28, 2021
1 parent cc3b2e8 commit 3e22137
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions v8go.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ void CPUProfileNodeDelete(CPUProfileNode* node) {
CPUProfileNodeDelete(node->children[i]);
}

delete[] node->children;
delete node;
}

Expand All @@ -294,6 +295,7 @@ void CPUProfileDelete(CPUProfile* profile) {
return;
}
profile->ptr->Delete();
free((void *)profile->title);

CPUProfileNodeDelete(profile->root);

Expand Down

0 comments on commit 3e22137

Please sign in to comment.