diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-03-03 13:12:31 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-03-03 13:12:31 -0800 |
commit | c82c36b4007bb94ba9c38324b0fc681e87ce2021 (patch) | |
tree | 6001b539336a00f9cb7c4d22eb350d1ed9ce541a /src | |
parent | 95fb8b125a273d1048b4a0cf8ce41c89cea4e189 (diff) | |
parent | dbb79631eb7231d82114aecaa5d0c7d8be6d34a9 (diff) |
Merge pull request #920 from vjpai/async-probs
Solving crashes in async tests
Diffstat (limited to 'src')
-rw-r--r-- | src/cpp/server/server.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 17b97f6ecf..2a5a7fe5eb 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -324,6 +324,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE { *tag = tag_; + bool orig_status = *status; if (*status && request_) { if (payload_) { *status = DeserializeProto(payload_, request_); @@ -343,7 +344,9 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { } ctx_->call_ = call_; Call call(call_, server_, cq_); - ctx_->BeginCompletionOp(&call); + if (orig_status && call_) { + ctx_->BeginCompletionOp(&call); + } // just the pointers inside call are copied here stream_->BindCall(&call); delete this; |