Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1393)

Unified Diff: runtime/vm/kernel.h

Issue 3000623002: [kernel] Free memory for kernel data. (Closed)
Patch Set: Remove commented out code Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel.h
diff --git a/runtime/vm/kernel.h b/runtime/vm/kernel.h
index aae1c28d33813c036fb2ecbc9503a6d66d4f7f4a..69a81c2e442d52a37ca0f292a06ad21bf53cc91c 100644
--- a/runtime/vm/kernel.h
+++ b/runtime/vm/kernel.h
@@ -116,6 +116,13 @@ class LogicalExpression {
class Program {
public:
+ ~Program() {
+ if (kernel_data_ != NULL) {
Kevin Millikin (Google) 2017/08/14 06:20:50 free checks for null. It's clunky to check here,
jensj 2017/08/14 08:38:12 Done.
+ free(const_cast<uint8_t*>(kernel_data_));
+ kernel_data_ = NULL;
+ }
+ }
+
static Program* ReadFrom(Reader* reader);
NameIndex main_method() { return main_method_reference_; }
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698