diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-19 14:51:10 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-19 14:51:10 -0700 |
commit | cfac954abcab7caf47d3fa3d641c553cba998271 (patch) | |
tree | 4cd546a2377e973fec54b75c1002c8c0ff321e8f /core/src/fxge/win32 | |
parent | df558514bf5cb5750d5a7000a843f45f4170d5a4 (diff) | |
download | pdfium-cfac954abcab7caf47d3fa3d641c553cba998271.tar.xz |
Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1192743004.
Diffstat (limited to 'core/src/fxge/win32')
-rw-r--r-- | core/src/fxge/win32/fx_win32_dib.cpp | 12 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_print.cpp | 4 |
2 files changed, 4 insertions, 12 deletions
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp index 7d6fe2efaa..191c2dc9cd 100644 --- a/core/src/fxge/win32/fx_win32_dib.cpp +++ b/core/src/fxge/win32/fx_win32_dib.cpp @@ -135,9 +135,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(const FX_WCHAR* filename) CFX_ByteString info = GetBitmapInfo(pDIBitmap); int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)info.c_str(), DIB_RGB_COLORS); if (!ret) { - if (pDIBitmap) { - delete pDIBitmap; - } + delete pDIBitmap; pDIBitmap = NULL; } DeleteDC(hDC); @@ -167,9 +165,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args) CFX_ByteString info = GetBitmapInfo(pDIBitmap); int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)info.c_str(), DIB_RGB_COLORS); if (!ret) { - if (pDIBitmap) { - delete pDIBitmap; - } + delete pDIBitmap; pDIBitmap = NULL; } DeleteDC(hDC); @@ -241,9 +237,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pP } } if (ret == 0) { - if (pDIBitmap) { - delete pDIBitmap; - } + delete pDIBitmap; pDIBitmap = NULL; } if (bCreatedDC) { diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index a8e8ce19fe..199ab78d9f 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -273,9 +273,7 @@ CPSPrinterDriver::CPSPrinterDriver() CPSPrinterDriver::~CPSPrinterDriver() { EndRendering(); - if (m_pPSOutput) { - delete m_pPSOutput; - } + delete m_pPSOutput; } FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) { |