summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/fsdk_define.h
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2014-07-18 09:14:35 -0700
committerNico Weber <thakis@chromium.org>2014-07-18 09:14:35 -0700
commit5eb9f7b4542cca34d4af96ea43be362446a4794f (patch)
treeb0a0fdd6b1c525bf3633d6de2b79b70058e2cc7d /fpdfsdk/include/fsdk_define.h
parenta9c29e006f74fefd96d5c3eab9d8233b321b296a (diff)
downloadpdfium-5eb9f7b4542cca34d4af96ea43be362446a4794f.tar.xz
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
Diffstat (limited to 'fpdfsdk/include/fsdk_define.h')
-rw-r--r--fpdfsdk/include/fsdk_define.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h
index 2bf4721c0d..433ff4c184 100644
--- a/fpdfsdk/include/fsdk_define.h
+++ b/fpdfsdk/include/fsdk_define.h
@@ -101,7 +101,7 @@ typedef unsigned int FX_UINT;
#include "fpdfview.h"
-class CPDF_CustomAccess : public IFX_FileRead, public CFX_Object
+class CPDF_CustomAccess FX_FINAL : public IFX_FileRead, public CFX_Object
{
public:
CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess);