diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-14 10:56:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-14 21:04:10 +0100 |
commit | a2eaf99e46f370ffb3b73828c2bdc53dc193b9a4 (patch) | |
tree | 6d08d7b5077478a92acde6dd6e7278e98a409ce1 /editeng/source/uno/unotext2.cxx | |
parent | 49a5e69f567302633299bf6626a9d9b9544ee94b (diff) |
make comphelper::OInterfaceContainerHelper4 more threadsafe
(*) make all the methods that require an external mutex take a
std::unique_lock as a parameter, so that call sites cannot forget
(*) make the forEach method drop the lock when firing listener methods,
to reduce the odds of deadlock
Change-Id: I0a80e3b3d1c1c03b7de4a658d31fcc2847690903
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/uno/unotext2.cxx')
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 275319f3dfe7..66f094a00e6a 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -242,13 +242,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); + maDisposeListeners.addInterface(aGuard, xListener); } void SAL_CALL SvxUnoTextContent::removeEventListener( const uno::Reference< lang::XEventListener >& aListener ) { std::unique_lock aGuard(maDisposeContainerMutex); - maDisposeListeners.removeInterface(aListener); + maDisposeListeners.removeInterface(aGuard, aListener); } // XEnumerationAccess |