From 408f4508d3c28e47034e4c19dba120b9176e4876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20W=C3=BChrer?= Date: Fri, 4 Sep 2020 11:26:25 +0200 Subject: [PATCH] include/fmt/core.h: detail::buffer: declare destructor as virtual, as it contains virtual methods. --- include/fmt/core.h | 2 +- include/fmt/format.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index d2c9633c..a35ddec2 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -669,7 +669,7 @@ template class buffer { size_(sz), capacity_(cap) {} - ~buffer() = default; + virtual ~buffer() = default; /** Sets the buffer data and capacity. */ void set(T* buf_data, size_t buf_capacity) FMT_NOEXCEPT { diff --git a/include/fmt/format.h b/include/fmt/format.h index 464c0d72..a33a90a9 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -633,7 +633,7 @@ class basic_memory_buffer : public detail::buffer { : alloc_(alloc) { this->set(store_, SIZE); } - ~basic_memory_buffer() { deallocate(); } + ~basic_memory_buffer() override { deallocate(); } private: // Move data from other to this buffer.