From 27c67a8a7aab8ac51da466a1893405832fe6ff08 Mon Sep 17 00:00:00 2001 From: Daniel Stevens Date: Thu, 20 Feb 2025 15:42:09 -0700 Subject: [PATCH] Mark `EventHandler::pump` as `virtual` This enables meaningful subclassing of `EventHandler`. As part of enabling subclassing, we also need a `virtual` destructor. The way it is accessed through `Utility` means the memory is managed using a base class pointer. --- NAS2D/EventHandler.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NAS2D/EventHandler.h b/NAS2D/EventHandler.h index 6f66f2f3..144d817c 100644 --- a/NAS2D/EventHandler.h +++ b/NAS2D/EventHandler.h @@ -62,6 +62,8 @@ namespace NAS2D using QuitSignal = Signal<>; public: + virtual ~EventHandler() = default; + ActivateSignal::Source& activate(); WindowHiddenSignal::Source& windowHidden(); @@ -111,7 +113,7 @@ namespace NAS2D bool numlock() const; bool control() const; - void pump(); + virtual void pump(); void disconnectAll();