diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-09-09 23:27:53 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-09-10 00:07:42 +0200 |
commit | 0f17d0f6d81bd953ebf0b2d9ef734d855c844de8 (patch) | |
tree | d9586de1049f1e56816abba87ec6f5ad908d1f2b /svx | |
parent | e658caeda9e98f001eec06495dc15d3687f345e9 (diff) |
svx: fix deadlock in accessibility::ChildrenManagerImpl
svx_unoapi svx.AccessibleShape on Windows:
One thread in ChildrenManagerImpl::GetChild() calling eventually
SdXShape::getPropertyValue() blocking on SolarMutex,
other thread calling ChildrenManagerImpl::CreateListOfVisibleShapes().
Not obvious if it's possible to release the maMutex in GetChild() around
calling ShapeTypeHandler::Instance().CreateAccessibleObject(),
since other methods here call GetChild() with maMutex locked themselves;
so just give up and use the SolarMutex in ChildrenManagerImpl too.
Change-Id: I9bf4e5926c4d01308513b1b4e88f20f9fd4c5648
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/ChildrenManagerImpl.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index 5a20a6808c5b..ed9dc7cc8fb7 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -21,6 +21,7 @@ #include "ChildrenManagerImpl.hxx" #include <svx/ShapeTypeHandler.hxx> #include <svx/AccessibleShapeInfo.hxx> +#include <vcl/svapp.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/container/XChild.hpp> @@ -139,7 +140,7 @@ uno::Reference<XAccessible> { if ( ! rChildDescriptor.mxAccessibleShape.is()) { - ::osl::MutexGuard aGuard (maMutex); + SolarMutexGuard g; // Make sure that the requested accessible object has not been // created while locking the global mutex. if ( ! rChildDescriptor.mxAccessibleShape.is()) @@ -201,7 +202,7 @@ void ChildrenManagerImpl::Update (bool bCreateNewObjectsOnDemand) // 3. Replace the current list of visible shapes with the new one. Do // the same with the visible area. { - ::osl::MutexGuard aGuard (maMutex); + SolarMutexGuard g; adjustIndexInParentOfShapes(aChildList); // Use swap to copy the contents of the new list in constant time. @@ -253,7 +254,7 @@ void ChildrenManagerImpl::Update (bool bCreateNewObjectsOnDemand) void ChildrenManagerImpl::CreateListOfVisibleShapes ( ChildDescriptorListType& raDescriptorList) { - ::osl::MutexGuard aGuard (maMutex); + SolarMutexGuard g; OSL_ASSERT (maShapeTreeInfo.GetViewForwarder() != NULL); @@ -420,7 +421,7 @@ void ChildrenManagerImpl::AddShape (const Reference<drawing::XShape>& rxShape) { if (rxShape.is()) { - ::osl::ClearableMutexGuard aGuard (maMutex); + SolarMutexClearableGuard aGuard; // Test visibility of the shape. Rectangle aVisibleArea = maShapeTreeInfo.GetViewForwarder()->GetVisibleArea(); @@ -470,7 +471,7 @@ void ChildrenManagerImpl::RemoveShape (const Reference<drawing::XShape>& rxShape { if (rxShape.is()) { - ::osl::ClearableMutexGuard aGuard (maMutex); + SolarMutexGuard g; // Search shape in list of visible children. ChildDescriptorListType::iterator I ( @@ -571,7 +572,7 @@ void ChildrenManagerImpl::SetInfo (const AccessibleShapeTreeInfo& rShapeTreeInfo Reference<frame::XController> xCurrentController; Reference<view::XSelectionSupplier> xCurrentSelectionSupplier; { - ::osl::MutexGuard aGuard (maMutex); + SolarMutexGuard g; xCurrentBroadcaster = maShapeTreeInfo.GetModelBroadcaster(); xCurrentController = maShapeTreeInfo.GetController(); xCurrentSelectionSupplier = Reference<view::XSelectionSupplier> ( @@ -751,7 +752,7 @@ void ChildrenManagerImpl::ViewForwarderChanged (ChangeType aChangeType, Update (false); else { - ::osl::MutexGuard aGuard (maMutex); + SolarMutexGuard g; ChildDescriptorListType::iterator I, aEnd = maVisibleChildren.end(); for (I=maVisibleChildren.begin(); I != aEnd; ++I) { |