File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -263,8 +263,8 @@ node::DebugOptions debug_options;
263263static struct {
264264#if NODE_USE_V8_PLATFORM
265265 void Initialize (int thread_pool_size) {
266- tracing_agent_ =
267- trace_enabled ? new tracing::Agent () : nullptr ;
266+ tracing_agent_. reset (
267+ trace_enabled ? new tracing::Agent () : nullptr ) ;
268268 platform_ = new NodePlatform (thread_pool_size,
269269 trace_enabled ? tracing_agent_->GetTracingController () : nullptr );
270270 V8::InitializePlatform (platform_);
@@ -276,8 +276,7 @@ static struct {
276276 platform_->Shutdown ();
277277 delete platform_;
278278 platform_ = nullptr ;
279- delete tracing_agent_;
280- tracing_agent_ = nullptr ;
279+ tracing_agent_.reset (nullptr );
281280 }
282281
283282 void DrainVMTasks (Isolate* isolate) {
@@ -314,7 +313,7 @@ static struct {
314313 return platform_;
315314 }
316315
317- tracing::Agent* tracing_agent_;
316+ std::unique_ptr< tracing::Agent> tracing_agent_;
318317 NodePlatform* platform_;
319318#else // !NODE_USE_V8_PLATFORM
320319 void Initialize (int thread_pool_size) {}
You can’t perform that action at this time.
0 commit comments