diff options
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> |