From 73131fc3806ce2a7da61c93590e467e5b044c341 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Fri, 9 Dec 2016 00:28:46 +0100 Subject: tdf#104105: fix Vcl lifecycle in CondFormat (reportdesign) Avoid this error: Window ( 7VclVBox()) with live children destroyed: N5rptui9ConditionE() * n by calling disposeAndClear on each element of m_aConditions m_aConditions is Conditions type Conditions type is ::std::vector< VclPtr > See http://opengrok.libreoffice.org/xref/core/reportdesign/source/ui/inc/CondFormat.hxx#70 Change-Id: Ie99f8cdb5acd787892237787525d79f3231689db Reviewed-on: https://gerrit.libreoffice.org/31775 Tested-by: Jenkins Reviewed-by: Julien Nabet --- reportdesign/source/ui/dlg/CondFormat.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'reportdesign') diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx index 84dd2b9b336c..32d81f7fa689 100644 --- a/reportdesign/source/ui/dlg/CondFormat.cxx +++ b/reportdesign/source/ui/dlg/CondFormat.cxx @@ -134,6 +134,12 @@ namespace rptui void ConditionalFormattingDialog::dispose() { + + for (auto i = m_aConditions.begin(); i != m_aConditions.end(); ++i) + { + i->disposeAndClear(); + } + m_aConditions.clear(); m_pConditionPlayground.clear(); m_pScrollWindow.clear(); @@ -190,7 +196,6 @@ namespace rptui Reference< XFormatCondition > xCond = m_xCopy->createFormatCondition(); ::comphelper::copyProperties(m_xCopy.get(),xCond.get()); m_xCopy->insertByIndex( _nNewCondIndex, makeAny( xCond ) ); - VclPtrInstance pCon( m_pConditionPlayground, *this, m_rController ); pCon->setCondition( xCond ); pCon->reorderWithinParent(_nNewCondIndex); -- cgit v1.2.3