diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:27:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:27:30 +0000 |
commit | a2baea7faff31d26459dab3668a39eae85e4991b (patch) | |
tree | eaa2048ce9c715481f932dcfe20368e252b77d2f /include/comphelper/interfacecontainer3.hxx | |
parent | Adding upstream version 4:24.2.0. (diff) | |
download | libreoffice-upstream/4%24.2.1.tar.xz libreoffice-upstream/4%24.2.1.zip |
Adding upstream version 4:24.2.1.upstream/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> |