commit 2c24591dc47601620deac4204e9c5d51c315eed8
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Mon Jul 14 12:21:05 2025 +0200
It turns out that Image requires a virtual constructor
Rule of 3 applies : define copy constructor and assignment too.
Fixes:
/usr/include/c++/v1/__memory/unique_ptr.h:80:5: warning: delete called on
'lyx::graphics::Image' that is abstract but has non-virtual destructor
[-Wdelete-abstract-non-virtual-dtor]
---
src/graphics/GraphicsImage.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/graphics/GraphicsImage.h b/src/graphics/GraphicsImage.h
index 0c23a42f47..2b413974b2 100644
--- a/src/graphics/GraphicsImage.h
+++ b/src/graphics/GraphicsImage.h
@@ -30,6 +30,10 @@ class Params;
class Image {
public:
+ /// A virtual destructor is needed by clang/libc++
+ ///
+ virtual ~Image() = default;
+
/// Create a copy
virtual Image * clone() const = 0;
@@ -53,6 +57,13 @@ public:
* Returns true if the pixmap is created.
*/
virtual bool setPixmap(Params const & params) = 0;
+protected:
+ ///
+ Image() = default;
+ ///
+ Image(Image const &) = default;
+ ///
+ Image & operator=(Image const &) = default;
};
/// Only way to create a new Image.
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs