From acee56691f1f6f367ffee42ab8ea709a6cf4d6be Mon Sep 17 00:00:00 2001 From: Rob De Reycke Date: Thu, 27 Oct 2022 00:37:20 +0200 Subject: [PATCH] xcb: Fix segmentation fault on destruction of QXcbConnection The same screen was detected twice. Fixes: QTBUG-104319 Change-Id: Id1f93d68de0306604f2e6a9104962a1d3b0db366 Reviewed-by: Liang Qi Reviewed-by: Jonas Kvinge (cherry picked from commit e39ca06dbc3051c8e82c458ccd7314a2adbff27e) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/xcb/qxcbconnection_screens.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp index aa0f2fef658..dc7b5fc632d 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp @@ -517,7 +517,8 @@ void QXcbConnection::initializeScreensFromMonitor(xcb_screen_iterator_t *it, int old.removeAll(screen); } } - m_screens << screen; + if (!m_screens.contains(screen)) + m_screens << screen; siblings << screen; // similar logic with QXcbConnection::initializeScreensFromOutput()