From 77268b2e6024c46ab67ab5ecf188cbbbe308230a Mon Sep 17 00:00:00 2001 From: Tony Tye Date: Sun, 10 Jan 2021 00:12:54 +0000 Subject: [PATCH] Add virtual destructor to device::Settings Add virtual destructor to device::Settings since derived classes are allocated, but are deleted using the base class. This ensures the descructors of the derived clsses will be executed if present. Change-Id: I1f974b986193c60128009a768ec6b01b9deeacd5 --- rocclr/device/device.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rocclr/device/device.hpp b/rocclr/device/device.hpp index 7413032b61..e5d4e55fb2 100644 --- a/rocclr/device/device.hpp +++ b/rocclr/device/device.hpp @@ -609,6 +609,10 @@ class Settings : public amd::HeapObject { //! Default constructor Settings(); + //! Virtual destructor as this class is used as a base class and is also used + //! to delete the derived classes. + virtual ~Settings() {}; + //! Check the specified extension bool checkExtension(uint name) const { return (extensions_ & (static_cast(1) << name)) ? true : false;