Skip to content
Snippets Groups Projects
Commit 91cda8ff authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

Merge pull request #6354 from ctiller/portabit

Fix double delete
parents 712cb789 904e0a50
No related branches found
No related tags found
No related merge requests found
...@@ -83,11 +83,15 @@ static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, ...@@ -83,11 +83,15 @@ static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
if (m->parent->shutdown) { if (m->parent->shutdown) {
ok = false; ok = false;
} else if (m->on_read != NULL) { } else if (m->on_read != NULL) {
gpr_slice_buffer_addn(m->on_read_out, slices->slices, slices->count); for (size_t i = 0; i < slices->count; i++) {
gpr_slice_buffer_add(m->on_read_out, gpr_slice_ref(slices->slices[i]));
}
grpc_exec_ctx_enqueue(exec_ctx, m->on_read, true, NULL); grpc_exec_ctx_enqueue(exec_ctx, m->on_read, true, NULL);
m->on_read = NULL; m->on_read = NULL;
} else { } else {
gpr_slice_buffer_addn(&m->read_buffer, slices->slices, slices->count); for (size_t i = 0; i < slices->count; i++) {
gpr_slice_buffer_add(&m->read_buffer, gpr_slice_ref(slices->slices[i]));
}
} }
gpr_mu_unlock(&m->parent->mu); gpr_mu_unlock(&m->parent->mu);
grpc_exec_ctx_enqueue(exec_ctx, cb, ok, NULL); grpc_exec_ctx_enqueue(exec_ctx, cb, ok, NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment