diff --git a/src/ray/rpc/client_call.h b/src/ray/rpc/client_call.h index 725652cb5..8bb175ed4 100644 --- a/src/ray/rpc/client_call.h +++ b/src/ray/rpc/client_call.h @@ -30,6 +30,8 @@ class ClientCall { /// The callback to be called by `ClientCallManager` when the reply of this request is /// received. virtual void OnReplyReceived() = 0; + + virtual ~ClientCall() = default; }; class ClientCallManager; @@ -142,7 +144,7 @@ class ClientCallManager { bool ok = false; // Keep reading events from the `CompletionQueue` until it's shutdown. while (cq_.Next(&got_tag, &ok)) { - ClientCall *call = reinterpret_cast(got_tag); + auto *call = reinterpret_cast(got_tag); if (ok) { // Post the callback to the main event loop. main_service_.post([call]() { diff --git a/src/ray/rpc/grpc_server.cc b/src/ray/rpc/grpc_server.cc index f50703999..3b1a13ec7 100644 --- a/src/ray/rpc/grpc_server.cc +++ b/src/ray/rpc/grpc_server.cc @@ -43,7 +43,7 @@ void GrpcServer::PollEventsFromCompletionQueue() { bool ok; // Keep reading events from the `CompletionQueue` until it's shutdown. while (cq_->Next(&tag, &ok)) { - ServerCall *server_call = static_cast(tag); + auto *server_call = static_cast(tag); // `ok == false` indicates that the server has been shut down. // We should delete the call object in this case. bool delete_call = !ok; diff --git a/src/ray/rpc/server_call.h b/src/ray/rpc/server_call.h index 08ca12832..f091ebbed 100644 --- a/src/ray/rpc/server_call.h +++ b/src/ray/rpc/server_call.h @@ -58,6 +58,8 @@ class ServerCall { /// Get the factory that created this `ServerCall`. virtual const ServerCallFactory &GetFactory() const = 0; + + virtual ~ServerCall() = default; }; /// The factory that creates a particular kind of `ServerCall` objects.