diff options
author | David Garcia Quintas <dgq@google.com> | 2015-05-07 17:20:24 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2015-05-07 17:20:24 -0700 |
commit | 4251aad3eb7bbc9220c8b4a8064da82416409ab3 (patch) | |
tree | cfbf2db24e0f40ab79fb535923873130b944c4b3 /src/csharp/Grpc.Core/GrpcEnvironment.cs | |
parent | d4f10c03209e731cf5d1793a23d3823ea2b05493 (diff) | |
parent | 442918f225797e28e1bfee023046af4f441a50ae (diff) |
Merge branch 'master' of github.com:grpc/grpc into standalone_benchmarks
Diffstat (limited to 'src/csharp/Grpc.Core/GrpcEnvironment.cs')
-rw-r--r-- | src/csharp/Grpc.Core/GrpcEnvironment.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs index 9c10a42e23..2e9e5a2ef6 100644 --- a/src/csharp/Grpc.Core/GrpcEnvironment.cs +++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs @@ -86,6 +86,8 @@ namespace Grpc.Core { instance.Close(); instance = null; + + CheckDebugStats(); } } } @@ -132,5 +134,19 @@ namespace Grpc.Core // TODO: use proper logging here Console.WriteLine("GRPC shutdown."); } + + private static void CheckDebugStats() + { + var remainingClientCalls = DebugStats.ActiveClientCalls.Count; + if (remainingClientCalls != 0) + { + Console.WriteLine("Warning: Detected {0} client calls that weren't disposed properly.", remainingClientCalls); + } + var remainingServerCalls = DebugStats.ActiveServerCalls.Count; + if (remainingServerCalls != 0) + { + Console.WriteLine("Warning: Detected {0} server calls that weren't disposed properly.", remainingServerCalls); + } + } } } |