diff --git a/src/d8.cc b/src/d8.cc index 544e824870..079913ddd6 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -1090,6 +1090,16 @@ void SourceGroup::WaitForThread() { #endif // V8_SHARED +ShellOptions::~ShellOptions() { + delete[] isolate_sources; + isolate_sources = NULL; +#ifndef V8_SHARED + delete parallel_files; + parallel_files = NULL; +#endif // V8_SHARED +} + + bool Shell::SetOptions(int argc, char* argv[]) { for (int i = 0; i < argc; i++) { if (strcmp(argv[i], "--stress-opt") == 0) { @@ -1198,7 +1208,7 @@ bool Shell::SetOptions(int argc, char* argv[]) { v8::V8::SetFlagsFromCommandLine(&argc, argv, true); - // set up isolated source groups + // Set up isolated source groups. options.isolate_sources = new SourceGroup[options.num_isolates]; SourceGroup* current = options.isolate_sources; current->Begin(argv, 1); diff --git a/src/d8.h b/src/d8.h index 052b7e09e3..052b4c023d 100644 --- a/src/d8.h +++ b/src/d8.h @@ -191,6 +191,8 @@ class ShellOptions { num_isolates(1), isolate_sources(NULL) { } + ~ShellOptions(); + #ifndef V8_SHARED bool use_preemption; int preemption_interval;