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

Unified Diff: xfa/fwl/core/fwl_widgetmgrimp.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/fwl/core/fwl_noteimp.cpp ('k') | xfa/fwl/theme/cfwl_checkboxtp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/fwl_widgetmgrimp.cpp
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp
index b1e0ca822afe5090081e361352a558206090fa71..0ce452edb038ac18ee9459b03969a25ea6775e34 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.cpp
+++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp
@@ -39,6 +39,7 @@ CFWL_WidgetMgr::CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative)
m_rtScreen.Reset();
#endif
}
+
CFWL_WidgetMgr::~CFWL_WidgetMgr() {
FX_POSITION ps = m_mapWidgetItem.GetStartPosition();
while (ps) {
@@ -48,11 +49,9 @@ CFWL_WidgetMgr::~CFWL_WidgetMgr() {
delete pItem;
}
m_mapWidgetItem.RemoveAll();
- if (m_pDelegate) {
- delete m_pDelegate;
- m_pDelegate = NULL;
- }
+ delete m_pDelegate;
}
+
int32_t CFWL_WidgetMgr::CountWidgets(IFWL_Widget* pParent) {
CFWL_WidgetMgrItem* pParentItem = GetWidgetMgrItem(pParent);
return TravelWidgetMgr(pParentItem, NULL, NULL);
@@ -480,18 +479,18 @@ IFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(IFWL_Widget* parent,
}
return parent;
}
+
void CFWL_WidgetMgr::NotifySizeChanged(IFWL_Widget* pForm,
FX_FLOAT fx,
FX_FLOAT fy) {
- if (!FWL_UseOffscreen(pForm)) {
+ if (!FWL_UseOffscreen(pForm))
return;
- }
+
CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pForm);
- if (pItem->pOffscreen) {
- delete pItem->pOffscreen;
- pItem->pOffscreen = NULL;
- }
+ delete pItem->pOffscreen;
+ pItem->pOffscreen = nullptr;
}
+
IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent,
IFWL_Widget* focus,
FX_BOOL& bFind) {
« no previous file with comments | « xfa/fwl/core/fwl_noteimp.cpp ('k') | xfa/fwl/theme/cfwl_checkboxtp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698