diff options
author | 2018-10-19 20:22:58 -0700 | |
---|---|---|
committer | 2018-10-19 20:22:58 -0700 | |
commit | 340bffa55560f02944dd81413aa764081a60f329 (patch) | |
tree | 501152a80ad403bbbe46f553256f6c184fd9c4df /include | |
parent | 397f20742f553aa258bb303e470b62fbb9cc288b (diff) | |
parent | ce4bd108ea18891836eb6372da404446ef1a1932 (diff) |
Merge pull request #16950 from vjpai/membug2
Fix CallOpSet copy/assignment to reset cq_tag
Diffstat (limited to 'include')
-rw-r--r-- | include/grpcpp/impl/codegen/call.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/grpcpp/impl/codegen/call.h b/include/grpcpp/impl/codegen/call.h index 7cadea0055..789ea805a3 100644 --- a/include/grpcpp/impl/codegen/call.h +++ b/include/grpcpp/impl/codegen/call.h @@ -624,6 +624,19 @@ class CallOpSet : public CallOpSetInterface, public Op6 { public: CallOpSet() : cq_tag_(this), return_tag_(this), call_(nullptr) {} + + // The copy constructor and assignment operator reset the value of + // cq_tag_ and return_tag_ since those are only meaningful on a specific + // object, not across objects. + CallOpSet(const CallOpSet& other) + : cq_tag_(this), return_tag_(this), call_(other.call_) {} + CallOpSet& operator=(const CallOpSet& other) { + cq_tag_ = this; + return_tag_ = this; + call_ = other.call_; + return *this; + } + void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) override { this->Op1::AddOp(ops, nops); this->Op2::AddOp(ops, nops); |