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

Unified Diff: xfa/fxfa/parser/xfa_locale.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 8 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
« no previous file with comments | « xfa/fxfa/parser/xfa_document_layout_imp.cpp ('k') | xfa/fxfa/parser/xfa_parser_imp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_locale.cpp
diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp
index ee6d289a25b7aae1acb21436120db6fcad23f23d..ff0371bc88d6e9849213d6558eec95a4501e5d28 100644
--- a/xfa/fxfa/parser/xfa_locale.cpp
+++ b/xfa/fxfa/parser/xfa_locale.cpp
@@ -21,14 +21,13 @@ static const FX_WCHAR g_FX_Currency[] = L"$z,zzz,zzz,zzz,zzz,zz9.99";
static const FX_WCHAR g_FX_Decimal[] = L"z,zzz,zzz,zzz,zzz,zz9.zzz";
static const FX_WCHAR g_FX_Integer[] = L"z,zzz,zzz,zzz,zzz,zzz";
-CXFA_XMLLocale::CXFA_XMLLocale(CXML_Element* pLocaleData) {
- m_pLocaleData = pLocaleData;
-}
+CXFA_XMLLocale::CXFA_XMLLocale(CXML_Element* pLocaleData)
+ : m_pLocaleData(pLocaleData) {}
+
CXFA_XMLLocale::~CXFA_XMLLocale() {
- if (m_pLocaleData) {
- delete m_pLocaleData;
- }
+ delete m_pLocaleData;
}
+
void CXFA_XMLLocale::Release() {
delete this;
}
« no previous file with comments | « xfa/fxfa/parser/xfa_document_layout_imp.cpp ('k') | xfa/fxfa/parser/xfa_parser_imp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698