ucb/source/sorter/sortresult.cxx | 19 ++++++++----------- ucb/source/sorter/sortresult.hxx | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-)
New commits: commit 05606d069c675accae5200db9b84caddb2d734bc Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Jul 20 22:08:00 2024 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Jul 24 19:20:32 2024 +0200 cid#1608102 Double unlock Change-Id: I8cb89726926d2f079735e81491f2b9f1d61f6416 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170807 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins (cherry picked from commit 2b2cbdb00696c3aa66a17e1e3a41fdb2b0863fa5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170868 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index 70052f440a49..27d0a504d970 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -1141,24 +1141,21 @@ sal_Int32 SortedResultSet::FindPos( SortListData const *pEntry, return nMid+1; } - -void SortedResultSet::PropertyChanged( const PropertyChangeEvent& rEvt ) +void SortedResultSet::PropertyChangedImpl(std::unique_lock<std::mutex>& rGuard, const PropertyChangeEvent& rEvt) { - std::unique_lock aGuard( maMutex ); - - if ( !maPropChangeListeners.hasContainedTypes(aGuard) ) + if ( !maPropChangeListeners.hasContainedTypes(rGuard) ) return; // Notify listeners interested especially in the changed property. OInterfaceContainerHelper4<XPropertyChangeListener>* pPropsContainer = - maPropChangeListeners.getContainer( aGuard, rEvt.PropertyName ); + maPropChangeListeners.getContainer( rGuard, rEvt.PropertyName ); if ( pPropsContainer ) - pPropsContainer->notifyEach( aGuard, &XPropertyChangeListener::propertyChange, rEvt ); + pPropsContainer->notifyEach( rGuard, &XPropertyChangeListener::propertyChange, rEvt ); // Notify listeners interested in all properties. - pPropsContainer = maPropChangeListeners.getContainer( aGuard, OUString() ); + pPropsContainer = maPropChangeListeners.getContainer( rGuard, OUString() ); if ( pPropsContainer ) - pPropsContainer->notifyEach( aGuard, &XPropertyChangeListener::propertyChange, rEvt ); + pPropsContainer->notifyEach( rGuard, &XPropertyChangeListener::propertyChange, rEvt ); } @@ -1264,7 +1261,7 @@ void SortedResultSet::CheckProperties( sal_Int32 nOldCount, bool bWasFinal ) aEvt.OldValue <<= nOldCount; aEvt.NewValue <<= GetCount(); - PropertyChanged( aEvt ); + PropertyChangedImpl(aGuard, aEvt); OUString aName = u"IsRowCountFinal"_ustr; Any aRet = getPropertyValue( aName ); @@ -1275,7 +1272,7 @@ void SortedResultSet::CheckProperties( sal_Int32 nOldCount, bool bWasFinal ) aEvt.PropertyHandle = -1; aEvt.OldValue <<= bWasFinal; aEvt.NewValue <<= bIsFinal; - PropertyChanged( aEvt ); + PropertyChangedImpl(aGuard, aEvt); } } } diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx index 51b768a3d4d6..b4da01c57c7d 100644 --- a/ucb/source/sorter/sortresult.hxx +++ b/ucb/source/sorter/sortresult.hxx @@ -136,7 +136,7 @@ private: sal_Int32 CompareImpl( const css::uno::Reference < css::sdbc::XResultSet >& xResultOne, const css::uno::Reference < css::sdbc::XResultSet >& xResultTwo, sal_Int32 nIndexOne, sal_Int32 nIndexTwo ); - void PropertyChanged( const css::beans::PropertyChangeEvent& rEvt ); + void PropertyChangedImpl(std::unique_lock<std::mutex>& rGuard, const css::beans::PropertyChangeEvent& rEvt); public: SortedResultSet( css::uno::Reference< css::sdbc::XResultSet > const & aResult );