diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2016-04-25 16:19:00 -0700 |
---|---|---|
committer | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2016-04-25 16:19:00 -0700 |
commit | 25ff54435e9f74fce0d8b35774e8f2813f827c9f (patch) | |
tree | bd7dd80fe85332055adbc586cfcd2f27b4f5d5da /test/core | |
parent | d64be98091c66f81c30de9c2a32825ee8eda97fd (diff) | |
parent | 653ea75ff571c7dc04371372068d240f4aa11983 (diff) |
Merge pull request #6277 from ctiller/shutdown_proper_like
Properly shutdown pollsets before destroying them
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/surface/concurrent_connectivity_test.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index a2fdf73596..28ddf58cc8 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -142,6 +142,12 @@ void bad_server_thread(void *vargs) { gpr_free(args->addr); } +static void done_pollset_shutdown(grpc_exec_ctx *exec_ctx, void *pollset, + bool success) { + grpc_pollset_destroy(pollset); + gpr_free(pollset); +} + int main(int argc, char **argv) { struct server_thread_args args; memset(&args, 0, sizeof(args)); @@ -207,8 +213,11 @@ int main(int argc, char **argv) { gpr_atm_rel_store(&args.stop, 1); gpr_thd_join(server); - grpc_pollset_destroy(args.pollset); - gpr_free(args.pollset); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_pollset_shutdown( + &exec_ctx, args.pollset, + grpc_closure_create(done_pollset_shutdown, args.pollset)); + grpc_exec_ctx_finish(&exec_ctx); grpc_shutdown(); return 0; |