summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-09-25 10:07:34 +0300
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-09-25 11:33:02 +0000
commitcf91dd10ff02916bace9281b0bfce02933e92814 (patch)
treedc887782126f8b4f0404c227c364d66b226a947c
parent10fd51a3e69a0a2ee6b8cd151fa6c847f684253c (diff)
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 <pierluigi.fiorini@gmail.com>
-rw-r--r--src/client/qwaylanddisplay.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index f197b3788..0bea9af65 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -194,6 +194,8 @@ void QWaylandDisplay::blockingReadEvents()
void QWaylandDisplay::exitWithError()
{
+ mEventThread->quit();
+ mEventThread->wait();
::exit(1);
}