From 56edd5fc5b3673581690d200e5783655637ab63a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 18 Jul 2018 01:29:01 +0200 Subject: [PATCH] src: close tracing event loop Clean up resources when tearing down the tracing agent. PR-URL: https://github.com/nodejs/node/pull/21867 Reviewed-By: James M Snell Reviewed-By: Eugene Ostroukhov Reviewed-By: Ali Ijaz Sheikh --- src/tracing/agent.cc | 6 ++++++ src/tracing/agent.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/tracing/agent.cc b/src/tracing/agent.cc index 641c476c1d8df7..ad842db63630dc 100644 --- a/src/tracing/agent.cc +++ b/src/tracing/agent.cc @@ -2,6 +2,8 @@ #include #include "tracing/node_trace_buffer.h" +#include "debug_utils.h" +#include "env-inl.h" namespace node { namespace tracing { @@ -53,6 +55,10 @@ Agent::Agent() { CHECK_EQ(uv_loop_init(&tracing_loop_), 0); } +Agent::~Agent() { + CheckedUvLoopClose(&tracing_loop_); +} + void Agent::Start() { if (started_) return; diff --git a/src/tracing/agent.h b/src/tracing/agent.h index b62dc5fe5bc9d5..e8bf727c505ce3 100644 --- a/src/tracing/agent.h +++ b/src/tracing/agent.h @@ -64,6 +64,7 @@ class AgentWriterHandle { class Agent { public: Agent(); + ~Agent(); TracingController* GetTracingController() { return tracing_controller_; }