From 2f300e297f6fc549c38d61a259f674b678b3599e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 4 Jun 2015 08:28:43 -0700 Subject: [PATCH] Proper init/shutdown --- src/core/debug/trace.c | 3 +++ src/core/debug/trace.h | 1 + src/core/surface/init.c | 1 + 3 files changed, 5 insertions(+) diff --git a/src/core/debug/trace.c b/src/core/debug/trace.c index e0b502bb9cc..b53dfe804bb 100644 --- a/src/core/debug/trace.c +++ b/src/core/debug/trace.c @@ -99,6 +99,9 @@ void grpc_tracer_init(const char *env_var) { parse(e); gpr_free(e); } +} + +void grpc_tracer_shutdown(void) { while (tracers) { tracer *t = tracers; tracers = t->next; diff --git a/src/core/debug/trace.h b/src/core/debug/trace.h index c02f14b7f20..fc8615bc693 100644 --- a/src/core/debug/trace.h +++ b/src/core/debug/trace.h @@ -38,5 +38,6 @@ void grpc_register_tracer(const char *name, int *flag); void grpc_tracer_init(const char *env_var_name); +void grpc_tracer_shutdown(void); #endif /* GRPC_INTERNAL_CORE_DEBUG_TRACE_H */ diff --git a/src/core/surface/init.c b/src/core/surface/init.c index ac6871c6f22..ca61a38a351 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -78,6 +78,7 @@ void grpc_shutdown(void) { grpc_iomgr_shutdown(); census_shutdown(); grpc_timers_global_destroy(); + grpc_tracer_shutdown(); } gpr_mu_unlock(&g_init_mu); }