diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-01-09 10:46:50 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-01-09 10:46:50 -0800 |
commit | b9e0190938f62bf21df078e47190a62ba33ddab2 (patch) | |
tree | 474749da63ac6890c008f9535b335bebee1d7cc8 /core/src | |
parent | b07772a31f5dff723af620bc57c71daa246995c0 (diff) | |
download | pdfium-b9e0190938f62bf21df078e47190a62ba33ddab2.tar.xz |
Fix -Wnon-virtual-dtor compiler warnings.
This is done by explicitly adding a virtual dtor to interface classes,
since the cost is small given that there are already virtual functions.
The exceptions are for classes that have a Release() or Delete() method,
in which case it is non-virtual and protected to indicate that the virtual
class is never the deletion point.
BUG=
R=brucedawson@chromium.org, thestig@chromium.org
Review URL: https://codereview.chromium.org/810883005
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fpdfapi/fpdf_font/ttgsubtable.cpp | 2 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_font/ttgsubtable.h | 5 | ||||
-rw-r--r-- | core/src/fpdfdoc/tagged_int.h | 9 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_Module.h | 1 | ||||
-rw-r--r-- | core/src/fxcrt/fx_arabic.h | 4 |
5 files changed, 16 insertions, 5 deletions
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp index 42f77de57b..e317aa67fd 100644 --- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp +++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp @@ -446,7 +446,7 @@ IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont) if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->m_pGsubData)) { return pGsubTable; } - delete pGsubTable; + pGsubTable->Release(); } return NULL; } diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h index c381a01304..6b1b4f2443 100644 --- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h +++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h @@ -414,6 +414,11 @@ public: delete this; } virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) FX_OVERRIDE; + CFX_CTTGSUBTable m_GsubImp; + +private: + ~CFX_GSUBTable() { } }; #endif + diff --git a/core/src/fpdfdoc/tagged_int.h b/core/src/fpdfdoc/tagged_int.h index d190db6427..7efd682887 100644 --- a/core/src/fpdfdoc/tagged_int.h +++ b/core/src/fpdfdoc/tagged_int.h @@ -6,7 +6,9 @@ #ifndef _FPDF_TAGGED_INT_H_ #define _FPDF_TAGGED_INT_H_ -class CPDF_StructTreeImpl; + +#include "../../include/fpdfdoc/fpdf_tagged.h" + class CPDF_StructElementImpl; class CPDF_StructTreeImpl : public CPDF_StructTree { @@ -36,7 +38,6 @@ class CPDF_StructElementImpl FX_FINAL : public CPDF_StructElement { public: CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict); - ~CPDF_StructElementImpl(); CPDF_StructTree* GetTree() const { return m_pTree; @@ -79,13 +80,15 @@ public: CPDF_StructElementImpl* Retain(); void Release(); protected: + ~CPDF_StructElementImpl(); + CPDF_StructTreeImpl* m_pTree; CFX_ByteString m_Type; CPDF_StructElementImpl* m_pParent; CPDF_Dictionary* m_pDict; CFX_ArrayTemplate<CPDF_StructKid> m_Kids; - int m_RefCount; + friend class CPDF_StructTreeImpl; }; #endif diff --git a/core/src/fxcodec/jbig2/JBig2_Module.h b/core/src/fxcodec/jbig2/JBig2_Module.h index 3a01eb094c..711cf4047b 100644 --- a/core/src/fxcodec/jbig2/JBig2_Module.h +++ b/core/src/fxcodec/jbig2/JBig2_Module.h @@ -10,6 +10,7 @@ class CJBig2_Module { public: + virtual ~CJBig2_Module() { } virtual void *JBig2_Malloc(FX_DWORD dwSize) = 0; diff --git a/core/src/fxcrt/fx_arabic.h b/core/src/fxcrt/fx_arabic.h index c404449af0..70ffc9c1ac 100644 --- a/core/src/fxcrt/fx_arabic.h +++ b/core/src/fxcrt/fx_arabic.h @@ -22,7 +22,9 @@ public: virtual FX_BOOL EndChar() FX_OVERRIDE; virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) FX_OVERRIDE; virtual void Reset() FX_OVERRIDE; -protected: + +private: + ~CFX_BidiChar() { } FX_BOOL m_bSeparateNeutral; FX_INT32 m_iCurStart; FX_INT32 m_iCurCount; |