[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Jan 30 19:22:55 UTC 2019
vcl/unx/gtk3/gtk3gtkinst.cxx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit f2a39ac20f0d79e169fb4b403fbddea268c72266
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jan 29 18:39:25 2019 +0100
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Jan 30 20:22:27 2019 +0100
vcl: fix deadlock in VclGtkClipboard::setContents()
Must not call getTransferDataFlavors with m_Mutex held;
6 TransferableHelper::getTransferDataFlavors() (this=0x567b980) at svtools/source/misc/transfer.cxx:392
7 VclGtkClipboard::setContents(com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&, com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboardOwner> const&) (this=0x3199550, xTrans=uno::Reference to (SwTransferable *) 0x567b9a8, xClipboardOwner=uno::Reference to (SwTransferable *) 0x567b9b0) at vcl/unx/gtk3_kde5/../gtk3/gtk3gtkinst.cxx:618
8 TransferableHelper::CopyToSelection(vcl::Window*) const (this=0x567b980, pWindow=0x301b0c0) at svtools/source/misc/transfer.cxx:960
CopyToSelection() uses SolarMutexReleaser, then getTransferDataFlavors()
has a SolarMutexGuard; this will deadlock against the main thread
that holds SolarMutex and calls VclGtkClipboard::setContents() itself,
from VclGtkClipboard::OwnerPossiblyChanged().
Change-Id: Ibda0b6bce6f3388c45cee8077dd977abb3dda366
Reviewed-on: https://gerrit.libreoffice.org/67121
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
(cherry picked from commit 9286cebdff378a19ec146183676c6da96aac77db)
Reviewed-on: https://gerrit.libreoffice.org/67154
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index e5b1cdf4f1d6..bd221af10cdb 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -606,6 +606,12 @@ void VclGtkClipboard::setContents(
const Reference< css::datatransfer::XTransferable >& xTrans,
const Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
{
+ css::uno::Sequence<css::datatransfer::DataFlavor> aFormats;
+ if (xTrans.is())
+ {
+ aFormats = xTrans->getTransferDataFlavors();
+ }
+
osl::ClearableMutexGuard aGuard( m_aMutex );
Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner );
Reference< datatransfer::XTransferable > xOldContents( m_aContents );
@@ -624,7 +630,6 @@ void VclGtkClipboard::setContents(
assert(m_aGtkTargets.empty());
if (m_aContents.is())
{
- css::uno::Sequence<css::datatransfer::DataFlavor> aFormats = xTrans->getTransferDataFlavors();
std::vector<GtkTargetEntry> aGtkTargets(m_aConversionHelper.FormatsToGtk(aFormats));
if (!aGtkTargets.empty())
{
More information about the Libreoffice-commits
mailing list