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
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index da22dc7..d2fdad4 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -49,7 +49,7 @@
 class IPDF_EnumPageHandler
 {
 public:
-
+    virtual ~IPDF_EnumPageHandler() { }
     virtual FX_BOOL EnumPage(CPDF_Dictionary* pPageDict) = 0;
 };
 class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjects
@@ -247,8 +247,7 @@
 public:
 
     CPDF_SyntaxParser();
-
-    ~CPDF_SyntaxParser();
+    virtual ~CPDF_SyntaxParser();
 
     void				InitParser(IFX_FileRead* pFileAccess, FX_DWORD HeaderOffset);
 
@@ -366,7 +365,7 @@
 class IPDF_DocParser : public CFX_Object
 {
 public:
-
+    virtual ~IPDF_DocParser() { }
     virtual FX_DWORD	GetRootObjNum() = 0;
 
     virtual FX_DWORD	GetInfoObjNum() = 0;
@@ -402,8 +401,7 @@
 public:
 
     CPDF_Parser();
-
-    ~CPDF_Parser();
+    ~CPDF_Parser() override;
 
     FX_DWORD			StartParse(FX_LPCSTR filename, FX_BOOL bReParse = FALSE);
 
@@ -853,13 +851,13 @@
 class IFX_FileAvail
 {
 public:
-
+    virtual ~IFX_FileAvail() { }
     virtual FX_BOOL			IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0;
 };
 class IFX_DownloadHints
 {
 public:
-
+    virtual ~IFX_DownloadHints() { }
     virtual void			AddSegment(FX_FILESIZE offset, FX_DWORD size) = 0;
 };
 #define PDF_IS_LINEARIZED			1
@@ -871,13 +869,12 @@
 class IPDF_DataAvail
 {
 public:
+    virtual ~IPDF_DataAvail() { }
 
     virtual FX_BOOL			IsDocAvail(IFX_DownloadHints* pHints) = 0;
 
-
     virtual void			SetDocument(CPDF_Document* pDoc) = 0;
 
-
     virtual FX_BOOL			IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;
 
     virtual FX_BOOL			IsLinearized() = 0;
diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h
index c059bed..e2801f6 100644
--- a/core/include/fpdfapi/fpdf_render.h
+++ b/core/include/fpdfapi/fpdf_render.h
@@ -138,7 +138,7 @@
 class IPDF_BackgroundDraw
 {
 public:
-
+    virtual ~IPDF_BackgroundDraw() { }
     virtual	void	OnDrawBackground(
         CFX_RenderDevice* pBitmapDevice,
         const CFX_AffineMatrix* pOriginal2Bitmap
diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h
index 78f9676..02bbf24 100644
--- a/core/include/fpdfdoc/fpdf_ap.h
+++ b/core/include/fpdfdoc/fpdf_ap.h
@@ -13,9 +13,8 @@
 class IPVT_FontMap
 {
 public:
-
+    virtual ~IPVT_FontMap() { }
     virtual CPDF_Font*						GetPDFFont(FX_INT32 nFontIndex) = 0;
-
     virtual CFX_ByteString					GetPDFFontAlias(FX_INT32 nFontIndex) = 0;
 };
 struct CPVT_Dash {
diff --git a/core/include/fpdfdoc/fpdf_tagged.h b/core/include/fpdfdoc/fpdf_tagged.h
index f3ab01e..1a2a5d4 100644
--- a/core/include/fpdfdoc/fpdf_tagged.h
+++ b/core/include/fpdfdoc/fpdf_tagged.h
@@ -68,6 +68,7 @@
 class CPDF_StructElement : public CFX_Object
 {
 public:
+    virtual ~CPDF_StructElement() { }
 
     virtual CPDF_StructTree*	GetTree() const = 0;
 
diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h
index 41025cb..3e23c3a 100644
--- a/core/include/fpdfdoc/fpdf_vt.h
+++ b/core/include/fpdfdoc/fpdf_vt.h
@@ -275,6 +275,7 @@
 class IPDF_VariableText_Provider
 {
 public:
+    virtual ~IPDF_VariableText_Provider() { }
 
     virtual FX_INT32						GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle) = 0;
 
@@ -291,6 +292,7 @@
 class IPDF_VariableText_Iterator
 {
 public:
+    virtual ~IPDF_VariableText_Iterator() { }
 
     virtual FX_BOOL							NextWord() = 0;
 
@@ -323,11 +325,9 @@
 class IPDF_VariableText
 {
 public:
-
     static IPDF_VariableText*			NewVariableText();
 
     static void							DelVariableText(IPDF_VariableText* pVT);
-public:
 
     virtual IPDF_VariableText_Provider*		SetProvider(IPDF_VariableText_Provider * pProvider) = 0;
 
@@ -440,5 +440,8 @@
     virtual FX_INT32						WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
 
     virtual CPVT_WordPlace					WordIndexToWordPlace(FX_INT32 index) const = 0;
+
+protected:
+    ~IPDF_VariableText() { }
 };
 #endif
diff --git a/core/include/fxcodec/fx_codec_provider.h b/core/include/fxcodec/fx_codec_provider.h
index a3ef396..53733e7 100644
--- a/core/include/fxcodec/fx_codec_provider.h
+++ b/core/include/fxcodec/fx_codec_provider.h
@@ -9,7 +9,6 @@
 class IFX_JpegProvider
 {
 public:
-
     virtual void		Release() = 0;
 
     virtual void*		CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
@@ -49,5 +48,8 @@
 
 
     virtual FX_DWORD	GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+
+protected:
+    ~IFX_JpegProvider() { }
 };
 #endif
diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h
index 4950f81..a7b25c1 100644
--- a/core/include/fxcrt/fx_arb.h
+++ b/core/include/fxcrt/fx_arb.h
@@ -16,5 +16,8 @@
     virtual FX_BOOL			EndChar() = 0;
     virtual FX_INT32		GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) = 0;
     virtual void			Reset() = 0;
+
+protected:
+    ~IFX_BidiChar() { }
 };
 #endif
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 98a540c..62324f5 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -240,7 +240,7 @@
 {
 public:
     IFX_BufferArchive(FX_STRSIZE size);
-
+    virtual ~IFX_BufferArchive() { }
 
     virtual void			Clear();
 
@@ -271,7 +271,7 @@
 {
 public:
     CFX_FileBufferArchive(FX_STRSIZE size = 32768);
-    ~CFX_FileBufferArchive();
+    ~CFX_FileBufferArchive() override;
     virtual void			Clear();
 
     FX_BOOL					AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE);
@@ -1377,7 +1377,7 @@
 class IFX_Pause
 {
 public:
-
+    virtual ~IFX_Pause() { }
     virtual FX_BOOL	NeedToPauseNow() = 0;
 };
 class CFX_DataFilter : public CFX_Object
diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h
index 8e298f7..e54af57 100644
--- a/core/include/fxcrt/fx_stream.h
+++ b/core/include/fxcrt/fx_stream.h
@@ -65,7 +65,7 @@
 class IFX_StreamWrite
 {
 public:
-
+    virtual ~IFX_StreamWrite() { }
     virtual void		Release() = 0;
 
     virtual	FX_BOOL		WriteBlock(const void* pData, size_t size) = 0;
@@ -91,6 +91,7 @@
 class IFX_StreamRead
 {
 public:
+    virtual ~IFX_StreamRead() { }
 
     virtual void			Release() = 0;
 
@@ -103,7 +104,6 @@
 class IFX_FileRead : IFX_StreamRead
 {
 public:
-
     virtual void			Release() = 0;
 
     virtual FX_FILESIZE		GetSize() = 0;
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h
index 99d9b7c..28d028c 100644
--- a/core/include/fxge/fpf.h
+++ b/core/include/fxge/fpf.h
@@ -12,6 +12,7 @@
 class IFPF_DeviceModule
 {
 public:
+    virtual ~IFPF_DeviceModule() { }
     virtual void				Destroy() = 0;
     virtual IFPF_FontMgr*		GetFontMgr() = 0;
 };
@@ -41,10 +42,14 @@
     virtual FX_INT32		GetHeight() const = 0;
     virtual FX_INT32		GetItalicAngle() const = 0;
     virtual FX_DWORD		GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWORD dwSize) = 0;
+
+protected:
+    ~IFPF_Font() { }
 };
 class IFPF_FontMgr
 {
 public:
+    virtual ~IFPF_FontMgr() { }
     virtual void			LoadSystemFonts() = 0;
     virtual void			LoadPrivateFont(IFX_FileRead* pFontFile) = 0;
     virtual void			LoadPrivateFont(FX_BSTR bsFileName) = 0;
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index d8a2003..f7e435d 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -402,16 +402,15 @@
 class IFX_ScanlineComposer
 {
 public:
+    virtual ~IFX_ScanlineComposer() { }
 
     virtual	void		ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha = NULL) = 0;
 
-
     virtual FX_BOOL		SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0;
 };
 class CFX_ScanlineCompositor : public CFX_Object
 {
 public:
-
     CFX_ScanlineCompositor();
 
     ~CFX_ScanlineCompositor();
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 52f8f30..bf9bb40 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -243,6 +243,7 @@
 class IFX_FontEnumerator
 {
 public:
+    virtual ~IFX_FontEnumerator() { }
 
     virtual void		HitFont() = 0;
 
@@ -251,6 +252,7 @@
 class IFX_AdditionalFontEnum
 {
 public:
+    virtual ~IFX_AdditionalFontEnum() { }
     virtual int  CountFiles() = 0;
     virtual IFX_FileStream* GetFontFile(int index) = 0;
 };
@@ -296,6 +298,7 @@
 public:
     static IFX_SystemFontInfo*	CreateDefault();
     virtual void		Release() = 0;
+
     virtual	FX_BOOL		EnumFontList(CFX_FontMapper* pMapper) = 0;
     virtual void*		MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact) = 0;
     virtual void*		GetFont(FX_LPCSTR face) = 0;
@@ -311,6 +314,8 @@
     {
         return NULL;
     }
+protected:
+    ~IFX_SystemFontInfo() { }
 };
 class CFX_FolderFontInfo : public IFX_SystemFontInfo
 {
@@ -423,6 +428,9 @@
 public:
     virtual void	Release() = 0;
     virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
+
+protected:
+     ~IFX_GSUBTable() { }
 };
 IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont);
 #endif
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index 82719ff..0c4bce8 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -637,9 +637,11 @@
 class IFX_PSOutput
 {
 public:
-
-    virtual void	OutputPS(FX_LPCSTR string, int len) = 0;
     virtual void  Release() = 0;
+    virtual void	OutputPS(FX_LPCSTR string, int len) = 0;
+
+protected:
+    ~IFX_PSOutput() { }
 };
 class CPSFont;
 class CFX_PSRenderer : public CFX_Object
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index 42f77de..e317aa6 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -446,7 +446,7 @@
         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 c381a01..6b1b4f2 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -414,6 +414,11 @@
         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 d190db6..7efd682 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 @@
 {
 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 @@
     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 3a01eb0..711cf40 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 c404449..70ffc9c 100644
--- a/core/src/fxcrt/fx_arabic.h
+++ b/core/src/fxcrt/fx_arabic.h
@@ -22,7 +22,9 @@
     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;
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index 9f97c52..5b8b42f 100644
--- a/fpdfsdk/include/fsdk_annothandler.h
+++ b/fpdfsdk/include/fsdk_annothandler.h
@@ -217,26 +217,28 @@
 
 class CPDFSDK_AnnotIterator
 {
-protected:
-	CPDFSDK_Annot*	NextAnnot (const CPDFSDK_Annot* pCurrent) ;
-	CPDFSDK_Annot*	PrevAnnot (const CPDFSDK_Annot* pCurrent) ;	
-	CPDFSDK_Annot*	NextAnnot(int& index ) ;
-	CPDFSDK_Annot*	PrevAnnot(int& index ) ;
 public:
     CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView, FX_BOOL bReverse,
-		FX_BOOL bIgnoreTopmost=FALSE,FX_BOOL bCircle=FALSE,CFX_PtrArray* pList=NULL);	
+		FX_BOOL bIgnoreTopmost=FALSE,FX_BOOL bCircle=FALSE,CFX_PtrArray* pList=NULL);
+    virtual ~CPDFSDK_AnnotIterator() { }
+
 	virtual CPDFSDK_Annot*	Next (const CPDFSDK_Annot* pCurrent) ;
 	virtual CPDFSDK_Annot*	Prev (const CPDFSDK_Annot* pCurrent) ;	
 	virtual CPDFSDK_Annot*	Next(int& index ) ;
 	virtual CPDFSDK_Annot*	Prev(int& index ) ;
 	virtual int             Count(){return m_pIteratorAnnotList.GetSize();}
-	
+
 	virtual FX_BOOL         InitIteratorAnnotList(CPDFSDK_PageView * pPageView,CFX_PtrArray* pList=NULL);
-	
+
 	void					InsertSort(CFX_PtrArray &arrayList, AI_COMPARE pCompare);
+
 protected:
-	//	CFX_PtrList			 m_pIteratorAnnotList; 
-	CFX_PtrArray	     m_pIteratorAnnotList;	
+	CPDFSDK_Annot*	NextAnnot (const CPDFSDK_Annot* pCurrent) ;
+	CPDFSDK_Annot*	PrevAnnot (const CPDFSDK_Annot* pCurrent) ;
+	CPDFSDK_Annot*	NextAnnot(int& index ) ;
+	CPDFSDK_Annot*	PrevAnnot(int& index ) ;
+
+	CFX_PtrArray	     m_pIteratorAnnotList;
 	FX_BOOL			     m_bReverse;
 	FX_BOOL              m_bIgnoreTopmost;
 	FX_BOOL              m_bCircle;
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h
index 95b9096..a8cd711 100644
--- a/fpdfsdk/include/fxedit/fx_edit.h
+++ b/fpdfsdk/include/fxedit/fx_edit.h
@@ -44,6 +44,7 @@
 class IFX_Edit_FontMap
 {
 public:
+        virtual ~IFX_Edit_FontMap() { }
 	//map a fontindex to pdf font.
 	virtual CPDF_Font *						GetPDFFont(FX_INT32 nFontIndex) = 0;
 	//get the alias of a pdf font.
@@ -58,8 +59,8 @@
 
 class IFX_Edit_Notify
 {
-	//this class is implemented by user
 public:
+        virtual ~IFX_Edit_Notify() { }
 	//set the horizontal scrollbar information.
 	virtual void							IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 
 												FX_FLOAT fContentMin, FX_FLOAT fContentMax, 
@@ -84,8 +85,9 @@
 
 class IFX_Edit_OprNotify
 {
-	//this class is implemented by user
 public:
+        virtual ~IFX_Edit_OprNotify() { }
+
 	//OprType: 0
 	virtual void							OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
 	//OprType: 1
@@ -143,10 +145,13 @@
 class IFX_Edit_UndoItem
 {
 public:
+	virtual void							Release() = 0;
 	virtual void							Undo() = 0;
 	virtual void							Redo() = 0;
 	virtual CFX_WideString					GetUndoTitle() = 0;
-	virtual void							Release() = 0;
+
+protected:
+        ~IFX_Edit_UndoItem() { }
 };
 
 class FXET_CLASS IFX_Edit
@@ -155,8 +160,7 @@
 	static IFX_Edit*						NewEdit();
 	static	void							DelEdit(IFX_Edit* pEdit);
 
-public:
-	//set a IFX_Edit_FontMap pointer implemented by user.
+        //set a IFX_Edit_FontMap pointer implemented by user.
 	virtual void							SetFontMap(IFX_Edit_FontMap* pFontMap) = 0;
 	//if user don't like to use FontMap, implement VTProvider and set it directly.
 	virtual void							SetVTProvider(IPDF_VariableText_Provider* pProvider) = 0;
@@ -371,7 +375,6 @@
 
 	virtual void							AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0;
 
-public:
 	static CFX_ByteString					GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, 
 													const CPVT_WordRange* pRange = NULL, 
 													FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
@@ -388,12 +391,15 @@
 													const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
 	static void								GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
 													const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color);
+
+protected:
+    ~IFX_Edit() { }
 };
 
 class IFX_List_Notify
 {
-	//this class is implemented by user
 public:
+        virtual ~IFX_List_Notify() { }
 	//set the horizontal scrollbar information.
 	virtual void							IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 
 												FX_FLOAT fContentMin, FX_FLOAT fContentMax, 
@@ -416,7 +422,6 @@
 	static IFX_List*						NewList();
 	static void								DelList(IFX_List* pList);
 
-public:
 	virtual void							SetFontMap(IFX_Edit_FontMap * pFontMap) = 0;
 	virtual void							SetNotify(IFX_List_Notify * pNotify) = 0;
 
@@ -465,7 +470,10 @@
 	virtual void							OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
 	virtual void							OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
 	virtual FX_BOOL							OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+
+protected:
+        ~IFX_List() { }
 };
 
-#endif 
+#endif
 
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index 7633bbb..8ea9a4e 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -11,13 +11,13 @@
 class Platform;
 }
 
-class IFXJS_Context  
+class IFXJS_Context
 {
 public:
+        virtual ~IFXJS_Context() { }
 	virtual FX_BOOL				Compile(const CFX_WideString& script, CFX_WideString& info) = 0;
 	virtual FX_BOOL				RunScript(const CFX_WideString& script, CFX_WideString& info) = 0;
 
-public:
 	virtual void				OnApp_Init() = 0;
 
 	virtual void				OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName) = 0;
@@ -31,7 +31,7 @@
 	virtual void				OnPage_Close(CPDFSDK_Document* pTarget) = 0;
 	virtual void				OnPage_InView(CPDFSDK_Document* pTarget) = 0;
 	virtual void				OnPage_OutView(CPDFSDK_Document* pTarget) = 0;
-	
+
 	virtual void				OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
 	virtual void				OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
 	virtual void				OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
@@ -88,6 +88,9 @@
 	virtual void				Exit() = 0;
 	virtual void				Enter() = 0;
 	virtual FX_BOOL				IsEntered() = 0;
+
+protected:
+         ~IFXJS_Runtime() { }
 };
 
 class CPDFDoc_Environment;
diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h
index d86cb77..7a4caaa 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h
@@ -14,6 +14,7 @@
 class IPWL_Filler_Notify
 {
 public:
+        virtual ~IPWL_Filler_Notify() { }
 	virtual void					QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, 
 										FX_INT32 & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top)
 	virtual void					OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
index b13d5e1..c9d87b2 100644
--- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
+++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
@@ -30,6 +30,7 @@
 class IPWL_Edit_Notify
 {
 public:
+        virtual ~IPWL_Edit_Notify() { }
 	//when the position of caret is changed in edit
 	virtual void					OnCaretMove(FX_INT32 x1, FX_INT32 y1, FX_INT32 x2, FX_INT32 y2) {}
 	virtual void					OnContentChange(const CPDF_Rect& rcContent){}
diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h
index effabd0..6b3d577 100644
--- a/fpdfsdk/include/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h
@@ -16,6 +16,7 @@
 class IPWL_IconList_Notify
 {
 public:
+        virtual ~IPWL_IconList_Notify() { }
 	virtual void						OnNoteListSelChanged(FX_INT32 nItemIndex) = 0;
 };
 
diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h
index b3f7358..125271f 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Note.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Note.h
@@ -27,6 +27,7 @@
 class IPWL_NoteNotify
 {
 public:
+	virtual ~IPWL_NoteNotify() { }
 	virtual void						OnNoteMove(const FX_RECT& rtWin) = 0;
 	virtual void						OnNoteShow(FX_BOOL bShow) = 0;
 	virtual void						OnNoteActivate(FX_BOOL bActive) = 0;
@@ -45,12 +46,14 @@
 class IPWL_NoteHandler
 {
 public:
+	virtual ~IPWL_NoteHandler() { }
 	virtual void						OnNoteColorChanged(const CPWL_Color& color) = 0;
 };
 
 class IPWL_NoteItem
 {
 public:
+	virtual ~IPWL_NoteItem() { }
 	virtual void						SetPrivateData(void* pData) = 0;
 	virtual void						SetBkColor(const CPWL_Color& color) = 0;
 	virtual void						SetSubjectName(const CFX_WideString& sName) = 0;
diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
index c3dd9b7..51a3058 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
@@ -168,6 +168,7 @@
 class IPWL_SpellCheck
 {
 public:
+        virtual ~IPWL_SpellCheck() { }
 	virtual FX_BOOL							CheckWord(FX_LPCSTR sWord) = 0;
 	virtual void							SuggestWords(FX_LPCSTR sWord, CFX_ByteStringArray & sSuggest) = 0;	
 };
@@ -175,6 +176,8 @@
 class IPWL_Provider
 {
 public:
+        virtual ~IPWL_Provider() { }
+
 	//get a matrix which map user space to CWnd client space
 	virtual CPDF_Matrix						GetWindowMatrix(void* pAttachedData) = 0;
 
@@ -193,6 +196,7 @@
 class IPWL_FocusHandler
 {
 public:
+        virtual ~IPWL_FocusHandler() { }
 	virtual void							OnSetFocus(CPWL_Wnd* pWnd) = 0;
 	virtual void							OnKillFocus(CPWL_Wnd* pWnd) = 0;
 };
diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp
index 0e0114b..f60dc97 100644
--- a/fpdfsdk/src/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp
@@ -75,6 +75,9 @@
 		if (m_pInfo->DeleteFont)
 			m_pInfo->DeleteFont(m_pInfo, hFont);
 	}
+
+private:
+        ~CSysFontInfo_Ext() { }
 };
 
 DLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper, const char* name, int charset)