diff options
author | Craig Tiller <ctiller@google.com> | 2016-04-25 07:40:23 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-04-25 07:40:23 -0700 |
commit | 653ea75ff571c7dc04371372068d240f4aa11983 (patch) | |
tree | 8b0554e0a5b83c70999fef60c0fb748db62a318c /test/core | |
parent | a75c63b1dbbbcb4b447d97b4c5eff19dcd3ff126 (diff) |
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; |