# HG changeset patch # User Andreas Weber # Date 1471413723 -7200 # Node ID fc127f0e1ccde60ad5ad164df78b372c725216ec # Parent 6d54ecbfb50a7be679264c57373c11dae4839a9d Fix race condition when printing with Qt toolkit (#48519 and #44463) ObjectProxy.cc: Use connect (..., Qt::BlockingQueuedConnection) graphics.cc: Remove sleep diff -r 6d54ecbfb50a -r fc127f0e1ccd libgui/graphics/ObjectProxy.cc --- a/libgui/graphics/ObjectProxy.cc Wed Aug 17 01:08:26 2016 -0400 +++ b/libgui/graphics/ObjectProxy.cc Wed Aug 17 08:02:03 2016 +0200 @@ -68,7 +68,8 @@ connect (this, SIGNAL (sendRedraw (void)), m_object, SLOT (slotRedraw (void))); connect (this, SIGNAL (sendPrint (const QString&, const QString&)), - m_object, SLOT (slotPrint (const QString&, const QString&))); + m_object, SLOT (slotPrint (const QString&, const QString&)), + Qt::BlockingQueuedConnection); } } } diff -r 6d54ecbfb50a -r fc127f0e1ccd libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Wed Aug 17 01:08:26 2016 -0400 +++ b/libinterp/corefcn/graphics.cc Wed Aug 17 08:02:03 2016 +0200 @@ -11106,7 +11106,13 @@ go.get_toolkit ().print_figure (go, term, file, debug_file); - octave_sleep (0.05); // FIXME: really needed? + // FIXME: In ObjectProxy.cc ObjectProxy::init + // we now use connect (..., Qt::BlockingQueuedConnection) + // which should make the sleep unnecessary. + // See bug #44463 and #48519 + // Remove it and the FIXME block above after testing. + + // octave_sleep (0.05); gh_manager::lock (); }