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

Unified Diff: core/src/fpdfdoc/pdf_vt.h

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 6 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/fpdfdoc/pdf_vt.h
diff --git a/core/src/fpdfdoc/pdf_vt.h b/core/src/fpdfdoc/pdf_vt.h
index 5acab96fbdc4c985198e4b11d6cfa33e870f5f4c..a75490fcd587c6fcc8818fd5010a8a4ff7dfdc85 100644
--- a/core/src/fpdfdoc/pdf_vt.h
+++ b/core/src/fpdfdoc/pdf_vt.h
@@ -84,12 +84,8 @@ struct CPVT_SectionInfo {
}
virtual ~CPVT_SectionInfo()
{
- if (pSecProps) {
- delete pSecProps;
- }
- if (pWordProps) {
- delete pWordProps;
- }
+ delete pSecProps;
+ delete pWordProps;
}
CPVT_SectionInfo(const CPVT_SectionInfo & other): rcSection(), nTotalLine(0), pSecProps(NULL), pWordProps(NULL)
{
@@ -148,9 +144,7 @@ struct CPVT_WordInfo {
}
virtual ~CPVT_WordInfo()
{
- if (pWordProps) {
- delete pWordProps;
- }
+ delete pWordProps;
}
CPVT_WordInfo(const CPVT_WordInfo & word): Word(0), nCharset(0),
fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(-1), pWordProps(NULL)

Powered by Google App Engine
This is Rietveld 408576698