summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics/cfx_path_generator.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-04-28 17:29:19 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-28 17:29:19 -0700
commit495bda110a6ea8e7a6fc313ec0232a9ca6e3cfdc (patch)
tree42abda300274f81009bdb9866e0f7e3f81164726 /xfa/fxgraphics/cfx_path_generator.cpp
parenta31098417852bdf13e693a6e0913e0706cf94098 (diff)
downloadpdfium-495bda110a6ea8e7a6fc313ec0232a9ca6e3cfdc.tar.xz
Do not check pointers before deleting them.
XFA edition. Review-Url: https://codereview.chromium.org/1925363002
Diffstat (limited to 'xfa/fxgraphics/cfx_path_generator.cpp')
-rw-r--r--xfa/fxgraphics/cfx_path_generator.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/xfa/fxgraphics/cfx_path_generator.cpp b/xfa/fxgraphics/cfx_path_generator.cpp
index ace3da154f..984e2e9d1a 100644
--- a/xfa/fxgraphics/cfx_path_generator.cpp
+++ b/xfa/fxgraphics/cfx_path_generator.cpp
@@ -6,18 +6,16 @@
#include "xfa/fxgraphics/cfx_path_generator.h"
-CFX_PathGenerator::CFX_PathGenerator() {
- m_pPathData = NULL;
-}
+CFX_PathGenerator::CFX_PathGenerator() : m_pPathData(nullptr) {}
+
void CFX_PathGenerator::Create() {
m_pPathData = new CFX_PathData;
}
+
CFX_PathGenerator::~CFX_PathGenerator() {
- if (m_pPathData) {
- delete m_pPathData;
- m_pPathData = NULL;
- }
+ delete m_pPathData;
}
+
void CFX_PathGenerator::AddPathData(CFX_PathData* pPathData) {
if (pPathData && pPathData->GetPointCount() > 0) {
int nCount = pPathData->GetPointCount();