From 3516256c28c29d13e9092e7bb3ea3b417d3bb6df Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 9 Jun 2017 01:04:52 -0700 Subject: Implement CPWL_ComboBox::OnDestroy() to manage unowned pointers. CPWL_ComboBox's unowned pointers to other CPWL_Wnds need to be released at the right time. Also release the unowned pointer for CPWL_Wnd's vertical scroll bar at the right time. BUG=729041 Change-Id: I06a1da35fcb18dae8faf9cd4fbc0b75d38f115b0 Reviewed-on: https://pdfium-review.googlesource.com/6418 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/pdfwindow/cpwl_wnd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fpdfsdk/pdfwindow/cpwl_wnd.cpp') diff --git a/fpdfsdk/pdfwindow/cpwl_wnd.cpp b/fpdfsdk/pdfwindow/cpwl_wnd.cpp index 57e2643220..90a79305eb 100644 --- a/fpdfsdk/pdfwindow/cpwl_wnd.cpp +++ b/fpdfsdk/pdfwindow/cpwl_wnd.cpp @@ -186,6 +186,7 @@ void CPWL_Wnd::Destroy() { KillFocus(); OnDestroy(); if (m_bCreated) { + m_pVScrollBar = nullptr; for (auto it = m_Children.rbegin(); it != m_Children.rend(); ++it) { if (CPWL_Wnd* pChild = *it) { *it = nullptr; @@ -201,7 +202,6 @@ void CPWL_Wnd::Destroy() { DestroyMsgControl(); m_sPrivateParam.Reset(); m_Children.clear(); - m_pVScrollBar = nullptr; } void CPWL_Wnd::Move(const CFX_FloatRect& rcNew, bool bReset, bool bRefresh) { -- cgit v1.2.3