summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddataoffer.cpp
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-04-30 19:44:58 +0300
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-06-09 08:22:56 +0000
commit8d691291a77ff0d3d24f3c8858c91c4daa805984 (patch)
tree6eb7a3695fe96b5fdbfd114426bcaaca0c9fc580 /src/client/qwaylanddataoffer.cpp
parentcaa58fe9e892cb95d4f990993c8e067b69530ed6 (diff)
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 <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/client/qwaylanddataoffer.cpp')
-rw-r--r--src/client/qwaylanddataoffer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp
index dd28f7870..167b647d6 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]);