* Add a virtual destructor to FTLayoutImpl to make sure derived classes have their destructors called. * Make all FTLayoutImpl members protected. Only its derived classes and FTLayout need to access them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
diff --git a/src/FTLayout/FTLayout.cpp b/src/FTLayout/FTLayout.cpp
index 227ceac..d0a550f 100644
--- a/src/FTLayout/FTLayout.cpp
+++ b/src/FTLayout/FTLayout.cpp
@@ -100,6 +100,19 @@ FT_Error FTLayout::Error() const
//
+FTLayoutImpl::FTLayoutImpl() :
+ err(0)
+{
+ ;
+}
+
+
+FTLayoutImpl::~FTLayoutImpl()
+{
+ ;
+}
+
+
void FTLayoutImpl::DoRender(FTFont *font, const unsigned int chr,
const unsigned int nextChr, int renderMode)
{
diff --git a/src/FTLayout/FTLayoutImpl.h b/src/FTLayout/FTLayoutImpl.h
index 9912587..6d739d7 100644
--- a/src/FTLayout/FTLayoutImpl.h
+++ b/src/FTLayout/FTLayoutImpl.h
@@ -34,7 +34,11 @@ class FTLayoutImpl
{
friend class FTLayout;
- public:
+ protected:
+ FTLayoutImpl();
+
+ virtual ~FTLayoutImpl();
+
/**
* Get the bounding box for a formatted string.
*