summaryrefslogtreecommitdiff
path: root/core/src/fxge/android
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-14 15:45:39 -0700
committerLei Zhang <thestig@chromium.org>2015-08-14 15:45:39 -0700
commitcb62e7657b3a9a04142028a4e6614029a08e894b (patch)
treee7fa5f4c7d7f12bff9315475a89872fb044c36b1 /core/src/fxge/android
parent0f6b51c0fdd14f5762bf3c7412ac59c825443cc3 (diff)
downloadpdfium-cb62e7657b3a9a04142028a4e6614029a08e894b.tar.xz
Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 .
Diffstat (limited to 'core/src/fxge/android')
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/core/src/fxge/android/fpf_skiafontmgr.h b/core/src/fxge/android/fpf_skiafontmgr.h
index 17bcb48ca1..0b33627cf3 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.h
+++ b/core/src/fxge/android/fpf_skiafontmgr.h
@@ -24,18 +24,12 @@ class CFPF_SkiaFontDescriptor {
m_iFaceIndex(0),
m_dwCharsets(0),
m_iGlyphNum(0) {}
- virtual ~CFPF_SkiaFontDescriptor() {
- if (m_pFamily) {
- FX_Free(m_pFamily);
- }
- }
+ virtual ~CFPF_SkiaFontDescriptor() { FX_Free(m_pFamily); }
virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Unknown; }
void SetFamily(const FX_CHAR* pFamily) {
- if (m_pFamily) {
- FX_Free(m_pFamily);
- }
+ FX_Free(m_pFamily);
int32_t iSize = FXSYS_strlen(pFamily);
m_pFamily = FX_Alloc(FX_CHAR, iSize + 1);
FXSYS_memcpy(m_pFamily, pFamily, iSize * sizeof(FX_CHAR));
@@ -51,19 +45,13 @@ class CFPF_SkiaFontDescriptor {
class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor {
public:
CFPF_SkiaPathFont() : m_pPath(NULL) {}
- ~CFPF_SkiaPathFont() override {
- if (m_pPath) {
- FX_Free(m_pPath);
- }
- }
+ ~CFPF_SkiaPathFont() override { FX_Free(m_pPath); }
// CFPF_SkiaFontDescriptor
int32_t GetType() const override { return FPF_SKIAFONTTYPE_Path; }
void SetPath(const FX_CHAR* pPath) {
- if (m_pPath) {
- FX_Free(m_pPath);
- }
+ FX_Free(m_pPath);
int32_t iSize = FXSYS_strlen(pPath);
m_pPath = FX_Alloc(FX_CHAR, iSize + 1);
FXSYS_memcpy(m_pPath, pPath, iSize * sizeof(FX_CHAR));