summaryrefslogtreecommitdiff
path: root/toolkit/source
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-11-23 17:01:46 +0100
committerTomaž Vajngerl <quikee@gmail.com>2016-11-24 12:35:29 +0000
commitbdd108cd72e630189c360c5327c480c1d64d55b1 (patch)
tree684f28bab926bcaf8dd748a8708d88323f13e031 /toolkit/source
parente190825b739712ba0c861d74fc1a589c7e94672d (diff)
tdf#103852 avoid clipboard deadlock
Deallocate the XTransferable object async using AsyncCallback (that uses Application::PostUserEvent) which executes the callback in a thread-safe way on the main thread. This avoids a deadlock at deallocation so that the XTransferable. Modify AsyncCallback to not hold the SolarMutexGuard because Application::PostUserEvent is considered thread-safe. Document Application::PostUserEvent thread-safety Change-Id: I4237a1cf380e8be66b3eefc393a58bb4853bf4e1 Reviewed-on: https://gerrit.libreoffice.org/31126 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'toolkit/source')
-rw-r--r--toolkit/source/awt/asynccallback.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx
index 95467f944d35..3860207e2584 100644
--- a/toolkit/source/awt/asynccallback.cxx
+++ b/toolkit/source/awt/asynccallback.cxx
@@ -88,8 +88,7 @@ void SAL_CALL AsyncCallback::addCallback(const css::uno::Reference< css::awt::XC
{
if ( Application::IsInMain() )
{
- SolarMutexGuard aSolarGuard;
-
+ // NOTE: We don't need SolarMutexGuard here as Application::PostUserEvent is thread-safe
CallbackData* pCallbackData = new CallbackData( xCallback, aData );
Application::PostUserEvent( LINK( this, AsyncCallback, Notify_Impl ), pCallbackData );
}