diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
commit | 5a7157d319477830426797532e02ac39d3b859f4 (patch) | |
tree | 3773f5ce209bee14a5643e98672e0f3828c71434 /include/comphelper/interfacecontainer3.hxx | |
parent | Releasing progress-linux version 4:24.2.0-3~progress7.99u1. (diff) | |
download | libreoffice-5a7157d319477830426797532e02ac39d3b859f4.tar.xz libreoffice-5a7157d319477830426797532e02ac39d3b859f4.zip |
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/comphelper/interfacecontainer3.hxx')
-rw-r--r-- | include/comphelper/interfacecontainer3.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/comphelper/interfacecontainer3.hxx b/include/comphelper/interfacecontainer3.hxx index 02f96658dc..be140d3228 100644 --- a/include/comphelper/interfacecontainer3.hxx +++ b/include/comphelper/interfacecontainer3.hxx @@ -266,7 +266,11 @@ template <class T> template <typename FuncT> inline void OInterfaceContainerHelper3<T>::forEach(FuncT const& func) { + osl::ClearableMutexGuard aGuard(mrMutex); + if (std::as_const(maData)->empty()) + return; OInterfaceIteratorHelper3<T> iter(*this); + aGuard.clear(); while (iter.hasMoreElements()) { auto xListener = iter.next(); @@ -314,7 +318,7 @@ OInterfaceContainerHelper3<ListenerT>::addInterface(const css::uno::Reference<Li osl::MutexGuard aGuard(mrMutex); maData->push_back(rListener); - return maData->size(); + return std::as_const(maData)->size(); } template <class ListenerT> @@ -337,7 +341,7 @@ sal_Int32 OInterfaceContainerHelper3<ListenerT>::removeInterface( if (it != maData->end()) maData->erase(it); - return maData->size(); + return std::as_const(maData)->size(); } template <class ListenerT> |