summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unoftn.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-01-14 10:56:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-14 21:04:10 +0100
commita2eaf99e46f370ffb3b73828c2bdc53dc193b9a4 (patch)
tree6d08d7b5077478a92acde6dd6e7278e98a409ce1 /sw/source/core/unocore/unoftn.cxx
parent49a5e69f567302633299bf6626a9d9b9544ee94b (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 'sw/source/core/unocore/unoftn.cxx')
-rw-r--r--sw/source/core/unocore/unoftn.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index 82c7f2555243..ca012bbb03e5 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -378,7 +378,7 @@ SwXFootnote::addEventListener(
{
// no need to lock here as m_pImpl is const and container threadsafe
std::unique_lock aGuard(m_pImpl->m_Mutex);
- m_pImpl->m_EventListeners.addInterface(xListener);
+ m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
}
void SAL_CALL
@@ -387,7 +387,7 @@ SwXFootnote::removeEventListener(
{
// no need to lock here as m_pImpl is const and container threadsafe
std::unique_lock aGuard(m_pImpl->m_Mutex);
- m_pImpl->m_EventListeners.removeInterface(xListener);
+ m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
}
const SwStartNode *SwXFootnote::GetStartNode() const