sw/source/core/unocore/unochart.cxx | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-)
New commits: commit 358298fd29caf3f20f84445aad0a907ccf54aff7 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sun Sep 29 12:27:06 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sun Sep 29 20:29:33 2024 +0200 simplify Change-Id: I18e27d76af250ab8fa6534fdb1876a90e3343d9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174185 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 10c79c82cd10..8d170ff4893e 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -2205,15 +2205,12 @@ void SAL_CALL SwChartDataSequence::disposing( const lang::EventObject& rSource ) void SAL_CALL SwChartDataSequence::dispose( ) { - bool bMustDispose( false ); { std::unique_lock aGuard( GetChartMutex() ); - bMustDispose = !m_bDisposed; - if (!m_bDisposed) - m_bDisposed = true; + if (m_bDisposed) + return; + m_bDisposed = true; } - if (!bMustDispose) - return; if (m_xDataProvider.is()) { @@ -2653,19 +2650,13 @@ void SAL_CALL SwChartLabeledDataSequence::removeModifyListener( void SAL_CALL SwChartLabeledDataSequence::dispose( ) { - bool bMustDispose( false ); - { - std::unique_lock aGuard( GetChartMutex() ); - bMustDispose = !m_bDisposed; - if (!m_bDisposed) - m_bDisposed = true; - } - if (!bMustDispose) + std::unique_lock aGuard( GetChartMutex() ); + if (m_bDisposed) return; + m_bDisposed = true; // require listeners to release references to this object lang::EventObject aEvtObj( static_cast< chart2::data::XLabeledDataSequence * >(this) ); - std::unique_lock aGuard( GetChartMutex() ); m_aModifyListeners.disposeAndClear( aGuard, aEvtObj ); m_aEventListeners.disposeAndClear( aGuard, aEvtObj ); }