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

Unified Diff: xfa/fwl/core/fwl_widgetimp.cpp

Issue 2207093005: Use smart pointers for class owned pointers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: one more change Created 4 years, 4 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/fwl/core/fwl_widgetimp.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/fwl_widgetimp.cpp
diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp
index 52a2978908f6ec00e47ada2296b0ef1ad430ab6c..3aa6233ae5e1e549da67cf76670cf5091d60a548 100644
--- a/xfa/fwl/core/fwl_widgetimp.cpp
+++ b/xfa/fwl/core/fwl_widgetimp.cpp
@@ -531,7 +531,8 @@ void CFWL_WidgetImp::SetAssociateWidget(void* pAssociate) {
CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
- : m_pProperties(new CFWL_WidgetImpProperties),
+ : m_pWidgetMgr(CFWL_WidgetMgr::GetInstance()),
+ m_pProperties(new CFWL_WidgetImpProperties(properties)),
m_pDelegate(nullptr),
m_pCurDelegate(nullptr),
m_pOuter(pOuter),
@@ -540,14 +541,10 @@ CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties,
m_pAssociate(nullptr),
m_iLock(0),
m_nEventKey(0) {
- *m_pProperties = properties;
- m_pWidgetMgr = CFWL_WidgetMgr::GetInstance();
ASSERT(m_pWidgetMgr);
}
-CFWL_WidgetImp::~CFWL_WidgetImp() {
- delete m_pProperties;
-}
+CFWL_WidgetImp::~CFWL_WidgetImp() {}
FX_BOOL CFWL_WidgetImp::IsEnabled() const {
return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0;
« no previous file with comments | « xfa/fwl/core/fwl_widgetimp.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698