From 6a775243b99e398422675e436a5e7b6c74c31acf Mon Sep 17 00:00:00 2001 From: Aurelien Labrosse Date: Thu, 19 Oct 2023 13:36:28 +0000 Subject: [PATCH] fix: virtual destructors in interfaces --- lib/Domain/IGunHal.hpp | 9 +++++---- lib/Domain/ITargetGui.hpp | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Domain/IGunHal.hpp b/lib/Domain/IGunHal.hpp index 0cc1efc..0f6c27f 100644 --- a/lib/Domain/IGunHal.hpp +++ b/lib/Domain/IGunHal.hpp @@ -18,8 +18,9 @@ class IGunHal { public: - virtual void isButton1Pressed() = 0; - virtual void isButton2Pressed() = 0; + virtual ~IGunHal() {} + virtual bool isButton1Pressed() = 0; + virtual bool isButton2Pressed() = 0; virtual void shortDelay() = 0; virtual void longDelay() = 0; virtual void ledOn() = 0; @@ -27,6 +28,6 @@ class IGunHal { virtual void laserOn() = 0; virtual void laserOff() = 0; virtual void vibrationOn() = 0; - virtual void vibrationOff() = 0; - virtual void deepSleep() = 0; + virtual void vibrationOff() = 0; + virtual void deepSleep() = 0; }; \ No newline at end of file diff --git a/lib/Domain/ITargetGui.hpp b/lib/Domain/ITargetGui.hpp index efc4537..6439432 100644 --- a/lib/Domain/ITargetGui.hpp +++ b/lib/Domain/ITargetGui.hpp @@ -30,6 +30,8 @@ class ITargetGui { Five }; + virtual ~ITargetGui() {} + /** * Tell GUI a target has been hit */