Fix obvious asan warnings. (#787)
Adds a few missing overrides and removes a std::move that prevented copy elision.master
							parent
							
								
									6125766c81
								
							
						
					
					
						commit
						923d643b86
					
				| 
						 | 
				
			
			@ -79,6 +79,8 @@ void Rpc::OnFinish() { handler_->OnFinish(); }
 | 
			
		|||
void Rpc::RequestNextMethodInvocation() {
 | 
			
		||||
  // Ask gRPC to notify us when the connection terminates.
 | 
			
		||||
  SetRpcEventState(Event::DONE, true);
 | 
			
		||||
  // TODO(gaschler): Asan reports direct leak of this new from both calls
 | 
			
		||||
  // StartServing and HandleNewConnection.
 | 
			
		||||
  server_context_.AsyncNotifyWhenDone(
 | 
			
		||||
      new RpcEvent{Event::DONE, weak_ptr_factory_(this), true});
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,7 +58,7 @@ class RpcHandler : public RpcHandlerInterface {
 | 
			
		|||
    const std::weak_ptr<Rpc> rpc_;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  void SetExecutionContext(ExecutionContext* execution_context) {
 | 
			
		||||
  void SetExecutionContext(ExecutionContext* execution_context) override {
 | 
			
		||||
    execution_context_ = execution_context;
 | 
			
		||||
  }
 | 
			
		||||
  void SetRpc(Rpc* rpc) override { rpc_ = rpc; }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ class AddFixedFramePoseDataHandler
 | 
			
		|||
            cartographer::sensor::FromProto(request.fixed_frame_pose_data()));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void OnReadsDone() {
 | 
			
		||||
  void OnReadsDone() override {
 | 
			
		||||
    Send(cartographer::common::make_unique<google::protobuf::Empty>());
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,7 +41,7 @@ class AddImuDataHandler
 | 
			
		|||
            cartographer::sensor::FromProto(request.imu_data()));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void OnReadsDone() {
 | 
			
		||||
  void OnReadsDone() override {
 | 
			
		||||
    Send(cartographer::common::make_unique<google::protobuf::Empty>());
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ class AddOdometryDataHandler
 | 
			
		|||
            cartographer::sensor::FromProto(request.odometry_data()));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void OnReadsDone() {
 | 
			
		||||
  void OnReadsDone() override {
 | 
			
		||||
    Send(cartographer::common::make_unique<google::protobuf::Empty>());
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ class AddRangefinderDataHandler
 | 
			
		|||
            cartographer::sensor::FromProto(request.timed_point_cloud_data()));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void OnReadsDone() {
 | 
			
		||||
  void OnReadsDone() override {
 | 
			
		||||
    Send(cartographer::common::make_unique<google::protobuf::Empty>());
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,8 +36,7 @@ class FinishTrajectoryHandler
 | 
			
		|||
        .FinishTrajectory(request.trajectory_id());
 | 
			
		||||
    GetUnsynchronizedContext<MapBuilderServer::MapBuilderContext>()
 | 
			
		||||
        ->NotifyFinishTrajectory(request.trajectory_id());
 | 
			
		||||
    Send(std::move(
 | 
			
		||||
        cartographer::common::make_unique<google::protobuf::Empty>()));
 | 
			
		||||
    Send(cartographer::common::make_unique<google::protobuf::Empty>());
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue