summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-17 15:18:10 +0200
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:23:05 +0200
commit91fb34e5bb8616e4fe7d30786d59c5383d8aa4e1 (patch)
treec4d1a99e8637df919be19ee9eb253bc402f3d750 /toolkit
parent999c01c133640d366d1ab28e5686b36cb2976fc4 (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 (cherry picked from commit 8e1ad966262932516b3368d9b5c44becb29524d4) Signed-off-by: Michael Stahl <mstahl@redhat.com>
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 82ad2b84b3d5..ee1f9b8a4b9d 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 d5c6ebf6da51..6daf05055150 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