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

Unified Diff: fpdfsdk/src/fpdfformfill.cpp

Issue 1195363002: Cleanup: Do not check pointers before deleting them, part 2. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 5 years, 5 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: fpdfsdk/src/fpdfformfill.cpp
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 021a78aacea7250733bb5178aad0dbf9ebf8cb5a..fb15332eae9223cccb112ae52c9fda564d3c7002 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -229,22 +229,13 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap,
}
pDevice->RestoreState();
- if(options.m_pOCContext)
- {
- delete options.m_pOCContext;
- options.m_pOCContext = NULL;
- }
- if(pContext)
- {
- delete pContext;
- pContext = NULL;
- }
- if(pDevice)
- {
- delete pDevice;
- pDevice = NULL;
- }
+ delete options.m_pOCContext;
Tom Sepez 2015/07/16 17:22:44 nit: funny indent.
Lei Zhang 2015/07/16 21:20:48 merge resolved this.
+ options.m_pOCContext = NULL;
+ delete pContext;
+ pContext = NULL;
Tom Sepez 2015/07/16 17:22:44 nit: pointless assignments?
+ delete pDevice;
+ pDevice = NULL;
}
DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, unsigned long color)

Powered by Google App Engine
This is Rietveld 408576698