Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1512)

Unified Diff: core/src/fxge/android/fpf_skiafontmgr.h

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fxge/android/fpf_skiafontmgr.h
diff --git a/core/src/fxge/android/fpf_skiafontmgr.h b/core/src/fxge/android/fpf_skiafontmgr.h
index c5dd8fd1b2527b996805f45fdd67592f4855eb10..5b20e604e5eae1a297bd8c9d81c093e03924f909 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.h
+++ b/core/src/fxge/android/fpf_skiafontmgr.h
@@ -21,15 +21,11 @@ class CFPF_SkiaFontDescriptor {
m_dwCharsets(0),
m_iGlyphNum(0) {}
virtual ~CFPF_SkiaFontDescriptor() {
- if (m_pFamily) {
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);
- }
int32_t iSize = FXSYS_strlen(pFamily);
m_pFamily = FX_Alloc(FX_CHAR, iSize + 1);
FXSYS_memcpy(m_pFamily, pFamily, iSize * sizeof(FX_CHAR));
@@ -45,15 +41,11 @@ class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor {
public:
CFPF_SkiaPathFont() : m_pPath(NULL) {}
virtual ~CFPF_SkiaPathFont() {
- if (m_pPath) {
FX_Free(m_pPath);
- }
}
virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Path; }
void SetPath(const FX_CHAR* pPath) {
- if (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));

Powered by Google App Engine
This is Rietveld 408576698