@@ -280,7 +280,8 @@ void GrpcClient::sendServerParam() const
280280
281281 ClientContext context;
282282 protos::Empty empty;
283- serverParam.set_allocated_register_response (M_register_response);
283+ protos::RegisterResponse* response = new protos::RegisterResponse (*M_register_response);
284+ serverParam.set_allocated_register_response (response);
284285 Status status = M_stub_->SendServerParams (&context, serverParam, &empty);
285286 if (!status.ok ())
286287 {
@@ -327,7 +328,8 @@ void GrpcClient::sendPlayerParams() const
327328
328329 ClientContext context;
329330 protos::Empty empty;
330- playerParam.set_allocated_register_response (M_register_response);
331+ protos::RegisterResponse* response = new protos::RegisterResponse (*M_register_response);
332+ playerParam.set_allocated_register_response (response);
331333 Status status = M_stub_->SendPlayerParams (&context, playerParam, &empty);
332334 if (!status.ok ())
333335 {
@@ -385,7 +387,8 @@ void GrpcClient::sendPlayerType() const
385387
386388 ClientContext context;
387389 protos::Empty empty;
388- playerTypeGrpc.set_allocated_register_response (M_register_response);
390+ protos::RegisterResponse* response = new protos::RegisterResponse (*M_register_response);
391+ playerTypeGrpc.set_allocated_register_response (response);
389392 Status status = M_stub_->SendPlayerType (&context, playerTypeGrpc, &empty);
390393 if (!status.ok ())
391394 {
@@ -403,7 +406,8 @@ void GrpcClient::sendInitMessage(bool offline_logging) const
403406 protos::Empty empty;
404407 protos::InitMessage initMessage;
405408 initMessage.set_debug_mode (offline_logging);
406- initMessage.set_allocated_register_response (M_register_response);
409+ protos::RegisterResponse* response = new protos::RegisterResponse (*M_register_response);
410+ initMessage.set_allocated_register_response (response);
407411 Status status = M_stub_->SendInitMessage (&context, initMessage, &empty);
408412 if (!status.ok ())
409413 {
0 commit comments