From b9e0190938f62bf21df078e47190a62ba33ddab2 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 9 Jan 2015 10:46:50 -0800 Subject: 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 --- core/src/fpdfapi/fpdf_font/ttgsubtable.cpp | 2 +- core/src/fpdfapi/fpdf_font/ttgsubtable.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'core/src/fpdfapi') 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 + -- cgit v1.2.3