From a7ed723edb23e8b384b7c4538e4b4b4c6701ac67 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Fri, 25 Sep 2015 10:07:34 +0300 Subject: [PATCH] Fix a segfault when the wayland connection is broken When calling ::exit() the socket notifier in the events thread may still fire before the process actually exits, using objects that are being destroyed and resulting in a segfault. Stop the events thread before calling ::exit(). Change-Id: I187762da2a7efa83db1e62b0e28dfab89f478c7d Reviewed-by: Pier Luigi Fiorini --- src/plugins/platforms/wayland/qwaylanddisplay.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index f197b378803..0bea9af659a 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -194,6 +194,8 @@ void QWaylandDisplay::blockingReadEvents() void QWaylandDisplay::exitWithError() { + mEventThread->quit(); + mEventThread->wait(); ::exit(1); }