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

Unified Diff: src/d8.cc

Issue 2488003002: [Tracing] Fix crash of --enable-tracing. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698