From 327d8ad7594ab4da9b7c670f5b5f5a164403b0d2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 8 May 2018 22:07:43 +1000 Subject: [PATCH] Mark Client, Window, Buffer and OptionManager as final Avoids warning about non virtual destructor calls on them, as they have a vtable due to OptionManagerWatcher. --- src/buffer.hh | 2 +- src/client.hh | 2 +- src/option_manager.hh | 2 +- src/window.hh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/buffer.hh b/src/buffer.hh index 6b98e7c8..202469bb 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -103,7 +103,7 @@ using BufferLines = Vector; // The Buffer class permits to read and mutate this file // representation. It also manage modifications undo/redo and // provides tools to deal with the line/column nature of text. -class Buffer : public SafeCountable, public OptionManagerWatcher, public Scope +class Buffer final : public SafeCountable, public Scope, private OptionManagerWatcher { public: enum class Flags diff --git a/src/client.hh b/src/client.hh index 1eb1e5d3..9d3daccd 100644 --- a/src/client.hh +++ b/src/client.hh @@ -22,7 +22,7 @@ enum class EventMode; enum class InfoStyle; enum class MenuStyle; -class Client : public SafeCountable, public OptionManagerWatcher +class Client final : public SafeCountable, public OptionManagerWatcher { public: using OnExitCallback = std::function; diff --git a/src/option_manager.hh b/src/option_manager.hh index 84c1be98..a7dc8ed2 100644 --- a/src/option_manager.hh +++ b/src/option_manager.hh @@ -78,7 +78,7 @@ public: virtual void on_option_changed(const Option& option) = 0; }; -class OptionManager : private OptionManagerWatcher +class OptionManager final : private OptionManagerWatcher { public: OptionManager(OptionManager& parent); diff --git a/src/window.hh b/src/window.hh index 94989046..c7cee384 100644 --- a/src/window.hh +++ b/src/window.hh @@ -13,7 +13,7 @@ namespace Kakoune { // A Window is a view onto a Buffer -class Window : public SafeCountable, public OptionManagerWatcher, public Scope +class Window final : public SafeCountable, public Scope, private OptionManagerWatcher { public: Window(Buffer& buffer);