From 3ed222f6497cf6b2b54d90a4de80fe2db9130f59 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 18 Feb 2018 18:21:04 +0100 Subject: don't use the global mutex for UI stuff This leads to deadlocks if one thread is using the process factory while holding the SolarMutex and another thread is calling the BackingComp::getTypes method. Change-Id: Ib4750aa1ebbfbf4f8dcd09ec2a218202450f4928 Reviewed-on: https://gerrit.libreoffice.org/49940 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- sfx2/source/dialog/backingcomp.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 76086dc404c7..8d4ee36b4dd4 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -90,6 +90,8 @@ private: /** the owner frame of this component. */ css::uno::Reference< css::frame::XFrame > m_xFrame; + osl::Mutex m_aTypeProviderMutex; + public: explicit BackingComp(); @@ -235,7 +237,7 @@ css::uno::Sequence< css::uno::Type > SAL_CALL BackingComp::getTypes() if (!pTypeCollection) { /* GLOBAL SAFE { */ - ::osl::MutexGuard aGlobalLock(::osl::Mutex::getGlobalMutex()); + ::osl::MutexGuard aGlobalLock(m_aTypeProviderMutex); // Control these pointer again ... it can be, that another instance will be faster then this one! if (!pTypeCollection) { -- cgit