winaccessibility: replace mysterious and inexplicable locking strategy
Do the conservative thing and lock the SolarMutex at every UNO API entry point. Change-Id: I51afffada975df7ee3435784aa050a2c19cd0ac8
This commit is contained in:
@@ -45,7 +45,6 @@ protected:
|
||||
AccObjectManagerAgent* pAgent;
|
||||
//disposed state indicator
|
||||
bool m_isDisposed;
|
||||
mutable ::osl::Mutex aRemoveMutex;
|
||||
public:
|
||||
AccEventListener( com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
|
||||
virtual ~AccEventListener();
|
||||
|
||||
@@ -72,9 +72,6 @@ private:
|
||||
AccObjectManagerAgent* pAgent;
|
||||
static AccObjectWinManager* me;
|
||||
ResIDGenerator ResIdGen;
|
||||
mutable ::osl::Mutex aDeleteMutex;
|
||||
mutable ::osl::Mutex aNotifyMutex;
|
||||
mutable ::osl::Mutex maATInterfaceMutex;
|
||||
|
||||
AccObjectWinManager(AccObjectManagerAgent* Agent=NULL);
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccComponentEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -47,6 +49,8 @@ AccComponentEventListener::~AccComponentEventListener()
|
||||
void AccComponentEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::VALUE_CHANGED:
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccContainerEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -47,6 +49,8 @@ AccContainerEventListener::~AccContainerEventListener()
|
||||
void AccContainerEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
short role = GetRole();
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccDescendantManagerEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -47,6 +49,8 @@ AccDescendantManagerEventListener::~AccDescendantManagerEventListener()
|
||||
void AccDescendantManagerEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::SELECTION_CHANGED:
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccDialogEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -44,6 +46,8 @@ AccDialogEventListener::~AccDialogEventListener()
|
||||
void AccDialogEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::CHILD:
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
#include <cppuhelper/bootstrap.hxx>
|
||||
#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
|
||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include <toolkit/awt/Vclxwindow.hxx>
|
||||
|
||||
#ifndef _SV_SYSDATA_HXX
|
||||
@@ -63,6 +66,7 @@ AccEventListener::~AccEventListener()
|
||||
void AccEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
@@ -230,7 +234,6 @@ void AccEventListener::RemoveMeFromBroadcaster()
|
||||
{
|
||||
try
|
||||
{
|
||||
osl::MutexGuard aGuard(aRemoveMutex);
|
||||
if(m_isDisposed)
|
||||
return;
|
||||
//get accessible context
|
||||
@@ -276,6 +279,8 @@ void AccEventListener::RemoveMeFromBroadcaster()
|
||||
void AccEventListener::disposing( const ::com::sun::star::lang::EventObject& /*Source*/ )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
RemoveMeFromBroadcaster();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccFrameEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -50,6 +52,8 @@ AccFrameEventListener::~AccFrameEventListener()
|
||||
void AccFrameEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::CHILD:
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccListEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -46,6 +48,8 @@ AccListEventListener::~AccListEventListener()
|
||||
*/
|
||||
void AccListEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccMenuEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -44,6 +46,8 @@ AccMenuEventListener::~AccMenuEventListener()
|
||||
void AccMenuEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::CHILD:
|
||||
|
||||
@@ -134,8 +134,6 @@ AccObjectWinManager::~AccObjectWinManager()
|
||||
|
||||
long AccObjectWinManager::Get_ToATInterface( HWND hWnd, long lParam, long wParam)
|
||||
{
|
||||
osl::MutexGuard localGuard(maATInterfaceMutex);//
|
||||
|
||||
IMAccessible* pRetIMAcc = NULL;
|
||||
|
||||
if(lParam == OBJID_CLIENT )
|
||||
@@ -216,7 +214,8 @@ AccObject* AccObjectWinManager::GetTopWindowAccObj(HWND hWnd)
|
||||
*/
|
||||
sal_Bool AccObjectWinManager::NotifyAccEvent(XAccessible* pXAcc,short state)
|
||||
{
|
||||
osl::MutexGuard aGuard(aNotifyMutex);
|
||||
// no idea why this checks for main thread but with this check no mutex
|
||||
// is needed here (the test only accesses Application const member)
|
||||
|
||||
if (!IsInMainThread())
|
||||
{
|
||||
@@ -564,7 +563,6 @@ void AccObjectWinManager::DeleteFromHwndXAcc(XAccessible* pXAcc )
|
||||
*/
|
||||
void AccObjectWinManager::DeleteChildrenAccObj(XAccessible* pXAcc)
|
||||
{
|
||||
osl::MutexGuard aGuard( aDeleteMutex );
|
||||
AccObject* currentObj=NULL;
|
||||
AccObject* childObj=NULL;
|
||||
XAccessible* pTmpXAcc=NULL;
|
||||
@@ -593,7 +591,6 @@ void AccObjectWinManager::DeleteChildrenAccObj(XAccessible* pXAcc)
|
||||
*/
|
||||
void AccObjectWinManager::DeleteAccObj( XAccessible* pXAcc )
|
||||
{
|
||||
osl::MutexGuard aGuard( aDeleteMutex );
|
||||
if( pXAcc == NULL )
|
||||
return;
|
||||
XIdToAccObjHash::iterator temp = XIdAccList.find(pXAcc);
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccParagraphEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -44,6 +46,8 @@ AccParagraphEventListener::~AccParagraphEventListener()
|
||||
void AccParagraphEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::CARET_CHANGED:
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccTableEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -45,6 +47,8 @@ AccTableEventListener::~AccTableEventListener()
|
||||
void AccTableEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccTextComponentEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <toolkit/awt/Vclxwindow.hxx>
|
||||
|
||||
#include <vcl/sysdata.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccTopWindowListener.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -141,6 +142,8 @@ void AccTopWindowListener::windowOpened( const ::com::sun::star::lang::EventObje
|
||||
if ( !pAccessible )
|
||||
return;
|
||||
|
||||
SolarMutexGuard g;
|
||||
|
||||
HandleWindowOpened( pAccessible );
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccTreeEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -43,6 +45,8 @@ AccTreeEventListener::~AccTreeEventListener()
|
||||
*/
|
||||
void AccTreeEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include "AccWindowEventListener.hxx"
|
||||
#include "AccObjectManagerAgent.hxx"
|
||||
#include "unomsaaevent.hxx"
|
||||
@@ -43,6 +45,8 @@ AccWindowEventListener::~AccWindowEventListener()
|
||||
*/
|
||||
void AccWindowEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
switch (aEvent.EventId)
|
||||
{
|
||||
case AccessibleEventId::CHILD:
|
||||
|
||||
@@ -28,9 +28,4 @@ bool IsInMainThread()
|
||||
return false;
|
||||
}
|
||||
|
||||
comphelper::SolarMutex& GetSolarMutex()
|
||||
{
|
||||
return Application::GetSolarMutex();
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -23,6 +23,4 @@
|
||||
|
||||
bool IsInMainThread();
|
||||
|
||||
comphelper::SolarMutex& GetSolarMutex();
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -114,6 +114,8 @@ void MSAAServiceImpl::initialize( Sequence< Any > const & args ) throw (Exceptio
|
||||
*/
|
||||
sal_Int32 MSAAServiceImpl::getAccObjectPtr ( long hWnd, long lParam, long wParam) throw (RuntimeException)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
return GetMSComPtr( hWnd, lParam, wParam );
|
||||
}
|
||||
|
||||
@@ -125,6 +127,8 @@ sal_Int32 MSAAServiceImpl::getAccObjectPtr ( long hWnd, long lParam, long wParam
|
||||
*/
|
||||
void MSAAServiceImpl::handleWindowOpened( sal_Int32 nAcc)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
SAL_INFO( "iacc2", "Window opened " << nAcc );
|
||||
handleWindowOpened_impl( nAcc );
|
||||
}
|
||||
@@ -308,6 +312,8 @@ MSAAServiceImpl::~MSAAServiceImpl()
|
||||
|
||||
void MSAAServiceImpl::dispose()
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
// As all folders and streams contain references to their parents,
|
||||
// we must remove these references so that they will be deleted when
|
||||
// the hash_map of the root folder is cleared, releasing all subfolders
|
||||
|
||||
Reference in New Issue
Block a user