summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_listbox.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-03 11:06:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-03 11:06:49 -0700
commit2d5b020304e8a9aa8afeb632c61daa7ece87e36d (patch)
tree4d7f04d4800577fa597b4ca1f1b4d31b87194ef0 /fpdfsdk/formfiller/cffl_listbox.cpp
parentca27127240fbca2184f1c576b15b5212d5b314e6 (diff)
downloadpdfium-2d5b020304e8a9aa8afeb632c61daa7ece87e36d.tar.xz
Use smart pointers for class owned pointers
For all classes under /fpdfsdk, use smart pointer to replace raw pointer type for class owned member variables so that memory management will be easier. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2173253002
Diffstat (limited to 'fpdfsdk/formfiller/cffl_listbox.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index cbac83cb55..a70a1f33ff 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -16,11 +16,9 @@
#define FFL_DEFAULTLISTBOXFONTSIZE 12.0f
CFFL_ListBox::CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget)
- : CFFL_FormFiller(pApp, pWidget), m_pFontMap(nullptr) {}
+ : CFFL_FormFiller(pApp, pWidget) {}
-CFFL_ListBox::~CFFL_ListBox() {
- delete m_pFontMap;
-}
+CFFL_ListBox::~CFFL_ListBox() {}
PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() {
PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
@@ -37,8 +35,8 @@ PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() {
cp.fFontSize = FFL_DEFAULTLISTBOXFONTSIZE;
if (!m_pFontMap)
- m_pFontMap = new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler());
- cp.pFontMap = m_pFontMap;
+ m_pFontMap.reset(new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler()));
+ cp.pFontMap = m_pFontMap.get();
return cp;
}