From 8d691291a77ff0d3d24f3c8858c91c4daa805984 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Thu, 30 Apr 2015 19:44:58 +0300 Subject: Fix a corner case freed memory use/crash QWaylandDisplay::flushRequests() does not only flush them, but also dispatches the pending events. If we have two wl_data_device.selection events in the queue we must not dispatch the second one while we are dealing with the first one because that will replace the data offer and delete us while we're in QWaylandMimeData::retrieveData_sys(). Change-Id: Ib58ca571867faa2633daa9ec94fe7094df02e9fd Reviewed-by: Laszlo Agocs --- src/client/qwaylanddataoffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index dd28f787..167b647d 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -136,7 +136,7 @@ QVariant QWaylandMimeData::retrieveData_sys(const QString &mimeType, QVariant::T } m_dataOffer->receive(mime, pipefd[1]); - m_display->flushRequests(); + wl_display_flush(m_display->wl_display()); close(pipefd[1]); -- cgit v1.2.3