diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2017-03-26 00:42:31 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2017-03-28 19:59:51 +0000 |
commit | 539470ebd5c47a7876ccc19df6110acacd477bb8 (patch) | |
tree | c056b2de1b815bc2aecbe30e1deb69e3d2943bf6 /chart2 | |
parent | 5d87c15ef0935081319afe2400c99df14d9fa258 (diff) |
it makes no sense for CC to leak resources when its unaware of model
- if the UNO_QUERY_THROW cast throws, this skips all of the disposing
(and thus leaks)
- the whole try-catch-ignore case has been there since early c6b95527
- even in that commit message, no sane justification has been given
- apparently the try-block was Java-style "catch exceptions until it
runs" cargo-cult
- this change is still the more conservative change: probably the whole
try-catch framing should be removed
Change-Id: Ie3a71e48eb056afd8a844e19898dc1555de4297e
Reviewed-on: https://gerrit.libreoffice.org/35690
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 3d163b791e1a..394a4e5b760b 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -803,8 +803,9 @@ void SAL_CALL ChartController::dispose() //--release all resources and references { - uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(getModel(), uno::UNO_QUERY_THROW); - x3DWindowProvider->setWindow(0); + uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(getModel(), uno::UNO_QUERY); + if(x3DWindowProvider.is()) + x3DWindowProvider->setWindow(0); uno::Reference< util::XModeChangeBroadcaster > xViewBroadcaster( m_xChartView, uno::UNO_QUERY ); if( xViewBroadcaster.is() ) @@ -818,7 +819,8 @@ void SAL_CALL ChartController::dispose() m_apDropTargetHelper.reset(); //the accessible view is disposed within window destructor of m_pChartWindow - m_xViewWindow->dispose(); //ChartWindow is deleted via UNO due to dispose of m_xViewWindow (triggered by Framework (Controller pretends to be XWindow also)) + if(m_xViewWindow.is()) + m_xViewWindow->dispose(); //ChartWindow is deleted via UNO due to dispose of m_xViewWindow (triggered by Framework (Controller pretends to be XWindow also)) m_xChartView.clear(); } @@ -865,6 +867,7 @@ void SAL_CALL ChartController::dispose() } catch( const uno::Exception & ex ) { + assert(!m_xChartView.is()); ASSERT_EXCEPTION( ex ); } } |