diff options
author | Nico Weber <thakis@chromium.org> | 2014-07-18 09:14:35 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2014-07-18 09:14:35 -0700 |
commit | 5eb9f7b4542cca34d4af96ea43be362446a4794f (patch) | |
tree | b0a0fdd6b1c525bf3633d6de2b79b70058e2cc7d /core/include/fpdfapi | |
parent | a9c29e006f74fefd96d5c3eab9d8233b321b296a (diff) | |
download | pdfium-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 'core/include/fpdfapi')
-rw-r--r-- | core/include/fpdfapi/fpdf_parser.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index c6c80778a1..feac6c67dc 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -397,7 +397,7 @@ public: #define PDFPARSE_ERROR_PASSWORD 3 #define PDFPARSE_ERROR_HANDLER 4 #define PDFPARSE_ERROR_CERT 5 -class CPDF_Parser : public IPDF_DocParser +class CPDF_Parser FX_FINAL : public IPDF_DocParser { public: @@ -945,7 +945,7 @@ enum PDF_DATAAVAIL_STATUS { PDF_DATAAVAIL_LOADALLFILE, PDF_DATAAVAIL_TRAILER_APPEND }; -class CPDF_DataAvail : public CFX_Object, public IPDF_DataAvail +class CPDF_DataAvail FX_FINAL : public CFX_Object, public IPDF_DataAvail { public: |