Commit 8d691291 authored by Giulio Camuffo's avatar Giulio Camuffo
Browse files

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: default avatarLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Showing with 1 addition and 1 deletion
......@@ -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]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment