include/fmt/core.h: detail::buffer: declare destructor as virtual, as it contains virtual methods.

This commit is contained in:
Martin Wührer 2020-09-04 11:26:25 +02:00
parent f8e00a084a
commit 408f4508d3
2 changed files with 2 additions and 2 deletions

View File

@ -669,7 +669,7 @@ template <typename T> class buffer {
size_(sz), size_(sz),
capacity_(cap) {} capacity_(cap) {}
~buffer() = default; virtual ~buffer() = default;
/** Sets the buffer data and capacity. */ /** Sets the buffer data and capacity. */
void set(T* buf_data, size_t buf_capacity) FMT_NOEXCEPT { void set(T* buf_data, size_t buf_capacity) FMT_NOEXCEPT {

View File

@ -633,7 +633,7 @@ class basic_memory_buffer : public detail::buffer<T> {
: alloc_(alloc) { : alloc_(alloc) {
this->set(store_, SIZE); this->set(store_, SIZE);
} }
~basic_memory_buffer() { deallocate(); } ~basic_memory_buffer() override { deallocate(); }
private: private:
// Move data from other to this buffer. // Move data from other to this buffer.