Properly shutdown pollsets before destroying them

pull/6277/head
Craig Tiller 9 years ago
parent a75c63b1db
commit 653ea75ff5
  1. 13
      test/core/surface/concurrent_connectivity_test.c

@ -142,6 +142,12 @@ void bad_server_thread(void *vargs) {
gpr_free(args->addr); 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) { int main(int argc, char **argv) {
struct server_thread_args args; struct server_thread_args args;
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
@ -207,8 +213,11 @@ int main(int argc, char **argv) {
gpr_atm_rel_store(&args.stop, 1); gpr_atm_rel_store(&args.stop, 1);
gpr_thd_join(server); gpr_thd_join(server);
grpc_pollset_destroy(args.pollset); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
gpr_free(args.pollset); grpc_pollset_shutdown(
&exec_ctx, args.pollset,
grpc_closure_create(done_pollset_shutdown, args.pollset));
grpc_exec_ctx_finish(&exec_ctx);
grpc_shutdown(); grpc_shutdown();
return 0; return 0;

Loading…
Cancel
Save