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

Unified Diff: runtime/bin/main.cc

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
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index a430f8d1f5185e299cf76eb85f6ab822e6397667..c492c95c99b885d6733dcc6375614a26ccaf5819 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -848,6 +848,7 @@ static Dart_Isolate IsolateSetupHelper(Dart_Isolate isolate,
if (dfe.kernel_file_specified()) {
ASSERT(kernel_program != NULL);
result = Dart_LoadKernel(kernel_program);
+ isolate_data->kernel_program = NULL; // Dart_LoadKernel takes ownership.
} else {
if (kernel_program != NULL) {
Dart_Handle uri = Dart_NewStringFromCString(script_uri);
@@ -857,6 +858,7 @@ static Dart_Isolate IsolateSetupHelper(Dart_Isolate isolate,
result =
Dart_LoadScript(uri, resolved_script_uri,
reinterpret_cast<Dart_Handle>(kernel_program), 0, 0);
+ isolate_data->kernel_program = NULL; // Dart_LoadScript takes ownership.
CHECK_RESULT(result);
}
}
@@ -1047,6 +1049,7 @@ static Dart_Isolate CreateAndSetupServiceIsolate(const char* script_uri,
if (dfe.UsePlatformBinary()) {
Dart_Handle library = Dart_LoadKernel(dfe.kernel_vmservice_io());
CHECK_RESULT_CLEANUP(library, isolate_data);
+ dfe.unset_kernel_vmservice_io(); // Dart_LoadKernel takes ownership.
skip_library_load = true;
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)

Powered by Google App Engine
This is Rietveld 408576698