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>
This commit is contained in:
Giulio Camuffo 2015-09-25 10:07:34 +03:00
parent eb1fe81b7d
commit a7ed723edb

View File

@ -194,6 +194,8 @@ void QWaylandDisplay::blockingReadEvents()
void QWaylandDisplay::exitWithError() void QWaylandDisplay::exitWithError()
{ {
mEventThread->quit();
mEventThread->wait();
::exit(1); ::exit(1);
} }