diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-18 20:57:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-20 18:12:48 +0100 |
commit | 97d00de4afe9827ddaf299cfdfa8534425a11fe6 (patch) | |
tree | 143682a896c20a8ecb0a4a2a28730cdca3b204be /editeng/source | |
parent | 1dc917b86cc1ae68dd9469e89c6f6aa2f9da5347 (diff) |
osl::Mutex->std::mutex in SvxUnoTextContent
Change-Id: I78c576cabc91488c9496aa684f42dde47f004103
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127115
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 00b123468a5a..275319f3dfe7 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -118,7 +118,6 @@ SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextBase& rText, sal_Int32 nPa : SvxUnoTextRangeBase(rText) , mnParagraph(nPara) , mrParentText(rText) -, maDisposeListeners(maDisposeContainerMutex) , mbDisposing( false ) { mxParentText = const_cast<SvxUnoTextBase*>(&rText); @@ -131,7 +130,6 @@ SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextContent& rContent ) noexce , lang::XTypeProvider() , cppu::OWeakAggObject() , mrParentText(rContent.mrParentText) -, maDisposeListeners(maDisposeContainerMutex) , mbDisposing( false ) { mxParentText = rContent.mxParentText; @@ -232,7 +230,10 @@ void SAL_CALL SvxUnoTextContent::dispose() lang::EventObject aEvt; aEvt.Source = *static_cast<OWeakAggObject*>(this); - maDisposeListeners.disposeAndClear(aEvt); + { + std::unique_lock aMutexGuard(maDisposeContainerMutex); + maDisposeListeners.disposeAndClear(aMutexGuard, aEvt); + } if( mxParentText.is() ) mxParentText->removeTextContent( this ); @@ -240,11 +241,13 @@ void SAL_CALL SvxUnoTextContent::dispose() void SAL_CALL SvxUnoTextContent::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) { + std::unique_lock aGuard(maDisposeContainerMutex); maDisposeListeners.addInterface(xListener); } void SAL_CALL SvxUnoTextContent::removeEventListener( const uno::Reference< lang::XEventListener >& aListener ) { + std::unique_lock aGuard(maDisposeContainerMutex); maDisposeListeners.removeInterface(aListener); } |