From fa022901cf2c9acdae9e9a24a68b9148d44f8627 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Sat, 22 Jun 2024 00:40:45 +0200 Subject: surface: add virtual destructor to surfacerole to avoid undefined behaviour (#6620) * surfacerole: add virtual destructor all classes that will be derived from should have a virtual destructor otherwise deleting an instance via pointer to a base class is undefined behaviour, layershell/xdgshell hits this with std::default_delete in the new sharedptr implentation. * includes: fix missing includes fix missing includes for no precompiled headers builds, and remove a redefiniton of a macro already defined in macros.hpp --- src/protocols/types/SurfaceRole.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/protocols') diff --git a/src/protocols/types/SurfaceRole.hpp b/src/protocols/types/SurfaceRole.hpp index 05c0ea66..faaf70ee 100644 --- a/src/protocols/types/SurfaceRole.hpp +++ b/src/protocols/types/SurfaceRole.hpp @@ -11,4 +11,5 @@ enum eSurfaceRole { class ISurfaceRole { public: virtual eSurfaceRole role() = 0; + virtual ~ISurfaceRole() = default; }; -- cgit v1.2.3