summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-17 15:18:10 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-17 15:24:19 +0200
commit8e1ad966262932516b3368d9b5c44becb29524d4 (patch)
tree4dbee378e3376712011631734195886fb41404e2 /toolkit
parent0f5b7dfea974c21b48843c3cbf7fdf344ad54a3a (diff)
Some missing SolarMutexGuard around VclPtr acquire/release
At least OutputDevice::acquire/release use a plain unguarded int and ++, --, so apparently rely on the SolarMutex being locked whenever they are called. Fixed those places that caused "make check" to fail for me when temporarily adding DBG_TESTSOLARMUTEX() to OutputDevice::acquire/release. (A recurring pattern is that a class fails to ensure the SolarMutex is locked around the destruction of non-null VclPtr members.) Change-Id: I77cba6f3908f2de1b516ce28f1c3c43b3f57a9c5
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxdevice.cxx3
-rw-r--r--toolkit/source/awt/vclxgraphics.cxx3
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx2
-rw-r--r--toolkit/source/controls/unocontrol.cxx8
4 files changed, 14 insertions, 2 deletions
diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx
index da7ad04a0b18..aff22613f286 100644
--- a/toolkit/source/awt/vclxdevice.cxx
+++ b/toolkit/source/awt/vclxdevice.cxx
@@ -50,6 +50,9 @@ VCLXDevice::VCLXDevice()
VCLXDevice::~VCLXDevice()
{
+ //TODO: why was this empty, and everything done in ~VCLXVirtualDevice?
+ SolarMutexGuard g;
+ mpOutputDevice.reset();
}
void VCLXDevice::SetCreatedWithToolkit( bool bCreatedWithToolkit )
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index 073afa5946fd..482e29c47021 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -80,6 +80,9 @@ VCLXGraphics::~VCLXGraphics()
}
delete mpClipRegion;
+
+ SolarMutexGuard g;
+ mpOutputDevice.reset();
}
void VCLXGraphics::SetOutputDevice( OutputDevice* pOutDev )
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index b5ddd771926a..cf141577038e 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1463,6 +1463,8 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > SAL_CALL VCLXToolkit::getDragGestureRecognizer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException, std::exception)
{
+ SolarMutexGuard g;
+
vcl::Window * pWindow = VCLUnoHelper::GetWindow( window );
if( pWindow )
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 9c85e6270596..0952e9796086 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -640,8 +640,12 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent
// Since the implementations for the listeners changed a lot towards 1.1, this
// would not be the case anymore, if we would not do this listener-lock below
// #i14703#
- vcl::Window* pVclPeer = VCLUnoHelper::GetWindow( getPeer() );
- VCLXWindow* pPeer = pVclPeer ? pVclPeer->GetWindowPeer() : NULL;
+ VCLXWindow* pPeer;
+ {
+ SolarMutexGuard g;
+ vcl::Window* pVclPeer = VCLUnoHelper::GetWindow( getPeer() );
+ pPeer = pVclPeer ? pVclPeer->GetWindowPeer() : NULL;
+ }
VclListenerLock aNoVclEventMultiplexing( pPeer );
// setting peer properties may result in an attempt to acquire the solar mutex, 'cause the peers