From 5eb9f7b4542cca34d4af96ea43be362446a4794f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 18 Jul 2014 09:14:35 -0700 Subject: pdfium: Fix all -Wdelete-non-virtual-dtor violations on Mac. Calling `delete` on an object of a type that has virtual functions but not a virtual destructor is questionable: Since the object has virtual functions, it likely has subclasses, so if it's deleted through the base pointer and the destructor isn't virtual, the subclass destructor won't be called. In most cases, the classes getting deleted can just be marked final to tell the compiler that it can't possibly have subclasses (this also enables the compiler to generate better code). Two classes didn't have any sub- or superclasses but virtual functions - this doesn't make sense, so make all methods of these classes non-virtual. (Also delete an unused function on one of the two classes.) In one case, a class actually did have a subclass that needs to be deleted virtually, so mark one destructor as virtual. BUG=none R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/370853002 --- core/src/fpdfdoc/tagged_int.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/src/fpdfdoc') diff --git a/core/src/fpdfdoc/tagged_int.h b/core/src/fpdfdoc/tagged_int.h index 0ebf4084a4..d190db6427 100644 --- a/core/src/fpdfdoc/tagged_int.h +++ b/core/src/fpdfdoc/tagged_int.h @@ -32,7 +32,7 @@ protected: CFX_ArrayTemplate m_Kids; friend class CPDF_StructElementImpl; }; -class CPDF_StructElementImpl : public CPDF_StructElement +class CPDF_StructElementImpl FX_FINAL : public CPDF_StructElement { public: CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict); -- cgit v1.2.3