Skip to content

Commit

Permalink
src: close tracing event loop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
addaleax authored and targos committed Aug 1, 2018
1 parent 4c9c1bb commit 56edd5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tracing/agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <string>
#include "tracing/node_trace_buffer.h"
#include "debug_utils.h"
#include "env-inl.h"

namespace node {
namespace tracing {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tracing/agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class AgentWriterHandle {
class Agent {
public:
Agent();
~Agent();

TracingController* GetTracingController() { return tracing_controller_; }

Expand Down

0 comments on commit 56edd5f

Please sign in to comment.