From c25299f4c4fa38c6b8725b96206625863c84947f Mon Sep 17 00:00:00 2001 From: zhaoyonghui Date: Fri, 24 May 2024 13:33:05 +0800 Subject: [PATCH 1/3] Add virtual destructors to MongoServiceAdaptor and SpanFilter --- src/brpc/mongo_service_adaptor.h | 2 ++ src/brpc/span.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/brpc/mongo_service_adaptor.h b/src/brpc/mongo_service_adaptor.h index 318e902ee2..d13205fd3d 100644 --- a/src/brpc/mongo_service_adaptor.h +++ b/src/brpc/mongo_service_adaptor.h @@ -46,6 +46,8 @@ class MongoContextMessage : public InputMessageBase { class MongoServiceAdaptor { public: + virtual ~MongoServiceAdaptor() = 0; + // Make an error msg when the cntl fails. If cntl fails, we must send mongo client a msg not // only to indicate the error, but also to finish the round trip. virtual void SerializeError(int response_to, butil::IOBuf* out_buf) const = 0; diff --git a/src/brpc/span.h b/src/brpc/span.h index 4427340592..e0aecc73fc 100644 --- a/src/brpc/span.h +++ b/src/brpc/span.h @@ -206,6 +206,7 @@ void AnnotateSpan(const char* fmt, ...); class SpanFilter { public: + virtual ~SpanFilter() = 0; virtual bool Keep(const BriefSpan&) = 0; }; From 58c634f2f5de2e00c2fc17716c19d237a3625bfc Mon Sep 17 00:00:00 2001 From: zhaoyonghui Date: Fri, 24 May 2024 15:59:48 +0800 Subject: [PATCH 2/3] Virtual desctructor in SpanFiler and MongoServiceAdaptor --- src/brpc/mongo_service_adaptor.h | 2 +- src/brpc/span.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/brpc/mongo_service_adaptor.h b/src/brpc/mongo_service_adaptor.h index d13205fd3d..496830975e 100644 --- a/src/brpc/mongo_service_adaptor.h +++ b/src/brpc/mongo_service_adaptor.h @@ -46,7 +46,7 @@ class MongoContextMessage : public InputMessageBase { class MongoServiceAdaptor { public: - virtual ~MongoServiceAdaptor() = 0; + virtual ~MongoServiceAdaptor() {} // Make an error msg when the cntl fails. If cntl fails, we must send mongo client a msg not // only to indicate the error, but also to finish the round trip. diff --git a/src/brpc/span.h b/src/brpc/span.h index e0aecc73fc..4281e38b83 100644 --- a/src/brpc/span.h +++ b/src/brpc/span.h @@ -206,7 +206,7 @@ void AnnotateSpan(const char* fmt, ...); class SpanFilter { public: - virtual ~SpanFilter() = 0; + virtual ~SpanFilter() {} virtual bool Keep(const BriefSpan&) = 0; }; From 8b92323c223294f7a0db48553ae39fa0ff93746b Mon Sep 17 00:00:00 2001 From: zhaoyonghui Date: Fri, 24 May 2024 16:09:44 +0800 Subject: [PATCH 3/3] Add virtual destructors to MongoServiceAdaptor and SpanFilte --- src/brpc/mongo_service_adaptor.h | 2 +- src/brpc/span.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/brpc/mongo_service_adaptor.h b/src/brpc/mongo_service_adaptor.h index 496830975e..d050fb6a11 100644 --- a/src/brpc/mongo_service_adaptor.h +++ b/src/brpc/mongo_service_adaptor.h @@ -46,7 +46,7 @@ class MongoContextMessage : public InputMessageBase { class MongoServiceAdaptor { public: - virtual ~MongoServiceAdaptor() {} + virtual ~MongoServiceAdaptor() = default; // Make an error msg when the cntl fails. If cntl fails, we must send mongo client a msg not // only to indicate the error, but also to finish the round trip. diff --git a/src/brpc/span.h b/src/brpc/span.h index 4281e38b83..1ef3d03c73 100644 --- a/src/brpc/span.h +++ b/src/brpc/span.h @@ -206,7 +206,7 @@ void AnnotateSpan(const char* fmt, ...); class SpanFilter { public: - virtual ~SpanFilter() {} + virtual ~SpanFilter() = default; virtual bool Keep(const BriefSpan&) = 0; };