summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Wnd.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/pdfwindow/PWL_Wnd.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/pdfwindow/PWL_Wnd.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index e680652bb3..4a479de0dc 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -80,15 +80,13 @@ void CPWL_Timer::TimerProc(int32_t idEvent) {
pTimer->m_pAttached->TimerProc();
}
-CPWL_TimerHandler::CPWL_TimerHandler() : m_pTimer(nullptr) {}
+CPWL_TimerHandler::CPWL_TimerHandler() {}
-CPWL_TimerHandler::~CPWL_TimerHandler() {
- delete m_pTimer;
-}
+CPWL_TimerHandler::~CPWL_TimerHandler() {}
void CPWL_TimerHandler::BeginTimer(int32_t nElapse) {
if (!m_pTimer)
- m_pTimer = new CPWL_Timer(this, GetSystemHandler());
+ m_pTimer.reset(new CPWL_Timer(this, GetSystemHandler()));
if (m_pTimer)
m_pTimer->SetPWLTimer(nElapse);