Fixes for destruction

reviewable/pr8239/r2
Craig Tiller 8 years ago
parent 32c804e6a7
commit 4b3b5d0e82
  1. 1
      src/core/lib/iomgr/tcp_posix.c
  2. 3
      test/core/util/mock_endpoint.c

@ -131,6 +131,7 @@ static void tcp_free(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
grpc_fd_orphan(exec_ctx, tcp->em_fd, tcp->release_fd_cb, tcp->release_fd, grpc_fd_orphan(exec_ctx, tcp->em_fd, tcp->release_fd_cb, tcp->release_fd,
"tcp_unref_orphan"); "tcp_unref_orphan");
gpr_slice_buffer_destroy(&tcp->last_read_buffer); gpr_slice_buffer_destroy(&tcp->last_read_buffer);
grpc_buffer_user_destroy(exec_ctx, &tcp->buffer_user);
gpr_free(tcp->peer_string); gpr_free(tcp->peer_string);
gpr_free(tcp); gpr_free(tcp);
} }

@ -90,13 +90,14 @@ static void me_really_destroy(grpc_exec_ctx *exec_ctx, void *mp,
grpc_error *error) { grpc_error *error) {
grpc_mock_endpoint *m = mp; grpc_mock_endpoint *m = mp;
gpr_slice_buffer_destroy(&m->read_buffer); gpr_slice_buffer_destroy(&m->read_buffer);
grpc_buffer_user_destroy(exec_ctx, &m->buffer_user);
gpr_free(m); gpr_free(m);
} }
static void me_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) { static void me_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep; grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
grpc_buffer_user_shutdown(exec_ctx, &m->buffer_user, grpc_buffer_user_shutdown(exec_ctx, &m->buffer_user,
grpc_closure_create(me_really_destroy, m)); grpc_closure_create(me_really_destroy, m));
} }
static char *me_get_peer(grpc_endpoint *ep) { static char *me_get_peer(grpc_endpoint *ep) {

Loading…
Cancel
Save