File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ class ComplexRedisSubscribeTask : public ComplexRedisTask
367367ProtocolMessage *
368368ComplexRedisSubscribeTask::SubscribeWrapper::next_in (ProtocolMessage *message)
369369{
370- redis_reply_t *reply = ((RedisResponse *)message)-> result_ptr ();
370+ redis_reply_t *reply = task_-> resp . result_ptr ();
371371
372372 if (reply->type != REDIS_REPLY_TYPE_ARRAY)
373373 {
@@ -385,7 +385,9 @@ ComplexRedisSubscribeTask::SubscribeWrapper::next_in(ProtocolMessage *message)
385385 task_->watching_ = true ;
386386 task_->extract_ (task_);
387387
388- task_->clear_resp ();
388+ RedisResponse resp;
389+ *(protocol::ProtocolMessage *)&resp = std::move (task_->resp );
390+ task_->resp = std::move (resp);
389391 return task_->finished_ ? NULL : &task_->resp ;
390392}
391393
Original file line number Diff line number Diff line change @@ -179,9 +179,10 @@ protected:
179179
180180 void clear_resp ()
181181 {
182- RESP resp;
183- *(protocol::ProtocolMessage *)&resp = std::move (this ->resp );
184- this ->resp = std::move (resp);
182+ protocol::ProtocolMessage head (std::move (this ->resp ));
183+ this ->resp .~RESP ();
184+ new (&this ->resp ) RESP;
185+ *(protocol::ProtocolMessage *)&this ->resp = std::move (head);
185186 }
186187
187188 void disable_retry ()
You can’t perform that action at this time.
0 commit comments