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

Side by Side Diff: core/src/fxge/win32/fx_win32_device.cpp

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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 8
9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_
10 #include <crtdbg.h> 10 #include <crtdbg.h>
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 pDash[i] = FXSYS_round( 688 pDash[i] = FXSYS_round(
689 pMatrix ? pMatrix->TransformDistance(pGraphState->m_DashArray[i]) 689 pMatrix ? pMatrix->TransformDistance(pGraphState->m_DashArray[i])
690 : pGraphState->m_DashArray[i]); 690 : pGraphState->m_DashArray[i]);
691 if (pDash[i] < 1) { 691 if (pDash[i] < 1) {
692 pDash[i] = 1; 692 pDash[i] = 1;
693 } 693 }
694 } 694 }
695 } 695 }
696 HPEN hPen = ExtCreatePen(PenStyle, (DWORD)FXSYS_ceil(width), &lb, 696 HPEN hPen = ExtCreatePen(PenStyle, (DWORD)FXSYS_ceil(width), &lb,
697 pGraphState->m_DashCount, (const DWORD*)pDash); 697 pGraphState->m_DashCount, (const DWORD*)pDash);
698 if (pDash) {
699 FX_Free(pDash); 698 FX_Free(pDash);
700 }
701 return hPen; 699 return hPen;
702 } 700 }
703 static HBRUSH _CreateBrush(FX_DWORD argb) { 701 static HBRUSH _CreateBrush(FX_DWORD argb) {
704 int a; 702 int a;
705 FX_COLORREF rgb; 703 FX_COLORREF rgb;
706 ArgbDecode(argb, a, rgb); 704 ArgbDecode(argb, a, rgb);
707 return CreateSolidBrush(rgb); 705 return CreateSolidBrush(rgb);
708 } 706 }
709 static void _SetPathToDC(HDC hDC, 707 static void _SetPathToDC(HDC hDC,
710 const CFX_PathData* pPathData, 708 const CFX_PathData* pPathData,
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 SelectObject(m_hDC, m_hOldBitmap); 1305 SelectObject(m_hDC, m_hOldBitmap);
1308 DeleteDC(m_hDC); 1306 DeleteDC(m_hDC);
1309 } 1307 }
1310 if (m_hBitmap) { 1308 if (m_hBitmap) {
1311 DeleteObject(m_hBitmap); 1309 DeleteObject(m_hBitmap);
1312 } 1310 }
1313 delete GetBitmap(); 1311 delete GetBitmap();
1314 } 1312 }
1315 1313
1316 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ 1314 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698