From 672a9e5a2d19a45a54bbd049ebfea7fbdb8ac323 Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:17:58 +0200 Subject: [PATCH] Make some dtors virtual --- include/log++.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/log++.h b/include/log++.h index 6f9a460..3b9f4a6 100644 --- a/include/log++.h +++ b/include/log++.h @@ -671,6 +671,7 @@ class InternalCondLog : public InternalLog { : InternalLog(severity) { should_print_ = cond; } + ~InternalCondLog() override = default; }; @@ -679,12 +680,14 @@ class LogPolicyBase { virtual void update() = 0; [[nodiscard]] virtual bool shouldLog() const = 0; virtual void onLog() {}; + virtual ~LogPolicyBase() = default; }; template class LogPolicy : public LogPolicyBase { public: explicit LogPolicy(T max) : max_(max) {} + ~LogPolicy() override = default; protected: T max_{0}; }; @@ -716,7 +719,7 @@ class OccasionPolicy : public CountableLogPolicy { return should_log_; } - virtual ~OccasionPolicy() = default; + ~OccasionPolicy() override = default; private: bool should_log_{false}; }; @@ -738,7 +741,7 @@ class FirstNOccurrencesPolicy : public CountableLogPolicy { return !is_n_occurences_reached; } - virtual ~FirstNOccurrencesPolicy() = default; + ~FirstNOccurrencesPolicy() override = default; private: bool is_n_occurences_reached = false; }; @@ -764,7 +767,7 @@ class TimePolicy : public LogPolicy { last_ = now_; } - virtual ~TimePolicy() = default; + ~TimePolicy() override = default; private: long now_{0}; long last_{0};