merlimat closed pull request #2754: [c++] Fixed virtual destructors URL: https://github.com/apache/pulsar/pull/2754
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pulsar-client-cpp/include/pulsar/CryptoKeyReader.h b/pulsar-client-cpp/include/pulsar/CryptoKeyReader.h index cb4cf15165..7edb58ea4c 100644 --- a/pulsar-client-cpp/include/pulsar/CryptoKeyReader.h +++ b/pulsar-client-cpp/include/pulsar/CryptoKeyReader.h @@ -28,7 +28,7 @@ namespace pulsar { class CryptoKeyReader { public: - CryptoKeyReader() {} + virtual ~CryptoKeyReader() {} /* * Return the encryption key corresponding to the key name in the argument diff --git a/pulsar-client-cpp/include/pulsar/Logger.h b/pulsar-client-cpp/include/pulsar/Logger.h index e319a04f0b..0d9ce4415c 100644 --- a/pulsar-client-cpp/include/pulsar/Logger.h +++ b/pulsar-client-cpp/include/pulsar/Logger.h @@ -34,6 +34,8 @@ class Logger { ERROR = 3 }; + virtual ~Logger() {} + virtual bool isEnabled(Level level) = 0; virtual void log(Level level, int line, const std::string& message) = 0; diff --git a/pulsar-client-cpp/include/pulsar/TopicMetadata.h b/pulsar-client-cpp/include/pulsar/TopicMetadata.h index 6413e2b374..6547333fbe 100644 --- a/pulsar-client-cpp/include/pulsar/TopicMetadata.h +++ b/pulsar-client-cpp/include/pulsar/TopicMetadata.h @@ -27,6 +27,8 @@ namespace pulsar { */ class TopicMetadata { public: + virtual ~TopicMetadata() {} + virtual int getNumPartitions() const = 0; }; } // namespace pulsar diff --git a/pulsar-client-cpp/lib/Hash.h b/pulsar-client-cpp/lib/Hash.h index f27847826d..367e66187d 100644 --- a/pulsar-client-cpp/lib/Hash.h +++ b/pulsar-client-cpp/lib/Hash.h @@ -25,6 +25,8 @@ namespace pulsar { class Hash { public: + virtual ~Hash() {} + /** * Generate the hash of a given String * ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services