Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 37586071b039adaccfe7c26395c3669546d2bd2d..fd9afee8081e2ce87ba8ae4bca2f30e6b245b462 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -2811,17 +2811,17 @@ int Shell::Main(int argc, char* argv[]) { |
? new PredictablePlatform() |
: v8::platform::CreateDefaultPlatform(); |
- std::unique_ptr<platform::tracing::TracingController> tracing_controller; |
+ platform::tracing::TracingController* tracing_controller; |
if (options.trace_enabled) { |
trace_file.open("v8_trace.json"); |
- tracing_controller.reset(new platform::tracing::TracingController()); |
+ tracing_controller = new platform::tracing::TracingController(); |
platform::tracing::TraceBuffer* trace_buffer = |
platform::tracing::TraceBuffer::CreateTraceBufferRingBuffer( |
platform::tracing::TraceBuffer::kRingBufferChunks, |
platform::tracing::TraceWriter::CreateJSONTraceWriter(trace_file)); |
tracing_controller->Initialize(trace_buffer); |
if (!i::FLAG_verify_predictable) { |
- platform::SetTracingController(g_platform, tracing_controller.release()); |
+ platform::SetTracingController(g_platform, tracing_controller); |
} |
} |
@@ -2941,6 +2941,9 @@ int Shell::Main(int argc, char* argv[]) { |
V8::Dispose(); |
V8::ShutdownPlatform(); |
delete g_platform; |
+ if (i::FLAG_verify_predictable) { |
+ delete tracing_controller; |
+ } |
return result; |
} |