diff --git a/cartographer_grpc/framework/rpc.cc b/cartographer_grpc/framework/rpc.cc index e6fc85d..08f111e 100644 --- a/cartographer_grpc/framework/rpc.cc +++ b/cartographer_grpc/framework/rpc.cc @@ -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}); diff --git a/cartographer_grpc/framework/rpc_handler.h b/cartographer_grpc/framework/rpc_handler.h index 901cb90..4a73cc5 100644 --- a/cartographer_grpc/framework/rpc_handler.h +++ b/cartographer_grpc/framework/rpc_handler.h @@ -58,7 +58,7 @@ class RpcHandler : public RpcHandlerInterface { const std::weak_ptr rpc_; }; - void SetExecutionContext(ExecutionContext* execution_context) { + void SetExecutionContext(ExecutionContext* execution_context) override { execution_context_ = execution_context; } void SetRpc(Rpc* rpc) override { rpc_ = rpc; } diff --git a/cartographer_grpc/handlers/add_fixed_frame_pose_data_handler.h b/cartographer_grpc/handlers/add_fixed_frame_pose_data_handler.h index 696959b..86b038a 100644 --- a/cartographer_grpc/handlers/add_fixed_frame_pose_data_handler.h +++ b/cartographer_grpc/handlers/add_fixed_frame_pose_data_handler.h @@ -42,7 +42,7 @@ class AddFixedFramePoseDataHandler cartographer::sensor::FromProto(request.fixed_frame_pose_data())); } - void OnReadsDone() { + void OnReadsDone() override { Send(cartographer::common::make_unique()); } }; diff --git a/cartographer_grpc/handlers/add_imu_data_handler.h b/cartographer_grpc/handlers/add_imu_data_handler.h index 6851e9e..edd1aa8 100644 --- a/cartographer_grpc/handlers/add_imu_data_handler.h +++ b/cartographer_grpc/handlers/add_imu_data_handler.h @@ -41,7 +41,7 @@ class AddImuDataHandler cartographer::sensor::FromProto(request.imu_data())); } - void OnReadsDone() { + void OnReadsDone() override { Send(cartographer::common::make_unique()); } }; diff --git a/cartographer_grpc/handlers/add_odometry_data_handler.h b/cartographer_grpc/handlers/add_odometry_data_handler.h index 36582eb..320b2a0 100644 --- a/cartographer_grpc/handlers/add_odometry_data_handler.h +++ b/cartographer_grpc/handlers/add_odometry_data_handler.h @@ -42,7 +42,7 @@ class AddOdometryDataHandler cartographer::sensor::FromProto(request.odometry_data())); } - void OnReadsDone() { + void OnReadsDone() override { Send(cartographer::common::make_unique()); } }; diff --git a/cartographer_grpc/handlers/add_rangefinder_data_handler.h b/cartographer_grpc/handlers/add_rangefinder_data_handler.h index 682cf5b..4942d49 100644 --- a/cartographer_grpc/handlers/add_rangefinder_data_handler.h +++ b/cartographer_grpc/handlers/add_rangefinder_data_handler.h @@ -42,7 +42,7 @@ class AddRangefinderDataHandler cartographer::sensor::FromProto(request.timed_point_cloud_data())); } - void OnReadsDone() { + void OnReadsDone() override { Send(cartographer::common::make_unique()); } }; diff --git a/cartographer_grpc/handlers/finish_trajectory_handler.h b/cartographer_grpc/handlers/finish_trajectory_handler.h index 29fe247..93b080a 100644 --- a/cartographer_grpc/handlers/finish_trajectory_handler.h +++ b/cartographer_grpc/handlers/finish_trajectory_handler.h @@ -36,8 +36,7 @@ class FinishTrajectoryHandler .FinishTrajectory(request.trajectory_id()); GetUnsynchronizedContext() ->NotifyFinishTrajectory(request.trajectory_id()); - Send(std::move( - cartographer::common::make_unique())); + Send(cartographer::common::make_unique()); } };