summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-11-23 17:01:46 +0100
committerMichael Stahl <mstahl@redhat.com>2016-11-24 13:57:46 +0000
commit69016f3052dcefa76486d83adbcc6d83df7d674b (patch)
tree065bfcf11840c58f9968da03ed233f63f51f588f /toolkit
parent65bc0588eb9e9212238768b3418711fbe881510f (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 Reviewed-on: https://gerrit.libreoffice.org/31126 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit bdd108cd72e630189c360c5327c480c1d64d55b1) Change-Id: I4237a1cf380e8be66b3eefc393a58bb4853bf4e1 Reviewed-on: https://gerrit.libreoffice.org/31168 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'toolkit')
-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 2d30afedc206..9268cb558119 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 );
}