Add a virtual destructor to the new class with virtual methods

pull/16646/head
Vijay Pai 6 years ago
parent 17fc4d4029
commit da1b75b5d5
  1. 1
      src/compiler/cpp_generator.cc
  2. 2
      test/cpp/codegen/compiler_test_golden

@ -560,6 +560,7 @@ void PrintHeaderClientMethodCallbackInterfacesStart(
// "Raw" methods since the callback-based API returns unowned raw pointers
printer->Print(" public:\n");
printer->Indent();
printer->Print("virtual ~experimental_async_interface() {}\n");
}
void PrintHeaderClientMethodCallbackInterfaces(

@ -108,6 +108,7 @@ class ServiceA final {
// Method A4 trailing comment 1
class experimental_async_interface {
public:
virtual ~experimental_async_interface() {}
// MethodA1 leading comment 1
virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0;
// MethodA1 trailing comment 1
@ -519,6 +520,7 @@ class ServiceB final {
// MethodB1 trailing comment 1
class experimental_async_interface {
public:
virtual ~experimental_async_interface() {}
// MethodB1 leading comment 1
virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0;
// MethodB1 trailing comment 1

Loading…
Cancel
Save