Skip to content

Commit 56edd5f

Browse files
addaleaxtargos
authored andcommitted
src: close tracing event loop
Clean up resources when tearing down the tracing agent. PR-URL: #21867 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
1 parent 4c9c1bb commit 56edd5f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/tracing/agent.cc

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <string>
44
#include "tracing/node_trace_buffer.h"
5+
#include "debug_utils.h"
6+
#include "env-inl.h"
57

68
namespace node {
79
namespace tracing {
@@ -53,6 +55,10 @@ Agent::Agent() {
5355
CHECK_EQ(uv_loop_init(&tracing_loop_), 0);
5456
}
5557

58+
Agent::~Agent() {
59+
CheckedUvLoopClose(&tracing_loop_);
60+
}
61+
5662
void Agent::Start() {
5763
if (started_)
5864
return;

src/tracing/agent.h

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class AgentWriterHandle {
6464
class Agent {
6565
public:
6666
Agent();
67+
~Agent();
6768

6869
TracingController* GetTracingController() { return tracing_controller_; }
6970

0 commit comments

Comments
 (0)