aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-07-30 10:40:22 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-07-30 11:58:19 -0700
commite2b3bfa4e4669611305798fdec31648a457ff935 (patch)
treeea900384254206c91f3b7da6df3ce5f6decdf58a /src/core
parent42b6c93c36d818a75344d16e353144a0e609e01e (diff)
Ensure server is alive when we free requested calls
Diffstat (limited to 'src/core')
-rw-r--r--src/core/surface/server.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index f19bcbd090..7031e63916 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -1271,6 +1271,8 @@ static void done_request_event(void *req, grpc_cq_completion *c) {
} else {
gpr_free(req);
}
+
+ server_unref(server);
}
static void fail_call(grpc_server *server, requested_call *rc) {
@@ -1283,6 +1285,7 @@ static void fail_call(grpc_server *server, requested_call *rc) {
rc->data.registered.initial_metadata->count = 0;
break;
}
+ server_ref(server);
grpc_cq_end_op(rc->cq_for_notification, rc->tag, 0, done_request_event, rc,
&rc->completion);
}
@@ -1293,6 +1296,8 @@ static void publish_registered_or_batch(grpc_call *call, int success,
grpc_call_stack_element(grpc_call_get_call_stack(call), 0);
requested_call *rc = prc;
call_data *calld = elem->call_data;
+ channel_data *chand = elem->channel_data;
+ server_ref(chand->server);
grpc_cq_end_op(calld->cq_new, rc->tag, success, done_request_event, rc,
&rc->completion);
GRPC_CALL_INTERNAL_UNREF(call, "server", 0);