Axel Spoerl 3416d28c8b QWindowsScreenManager::removeScreen() - don't leave stale screen behind
QWindowsScreenManager::removeScreen() read an element from m_screens
and removed it. If the removed screen was not the primary screen,
QWindowSystemInterface::flushWindowSystemEvents() is called.

When removeScreen() is called from handleScreenChanges() in the same
class, flushing window events can lead to a re-entry. That is e.g. the
case when a RDP connection is closed and the server removes the virtual
screen.

QWindowScreenManager::removeScreen() removes the platform screen only
at the very end, which means that m_screens contains a stale pointer.
The re-entry can therefore crash with a double delete.

Take the platform screen at the beginning of the method, to make it
safe for re-entry.

Fixes: QTBUG-135337
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Id18a6fb3e72922bcdb62c9e79857b6bb713c0c1b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2025-06-14 17:51:17 +02:00
2024-11-05 14:36:16 +01:00
2025-06-14 12:48:30 +02:00
2025-06-05 00:07:53 +01:00
2025-03-24 23:19:04 +01:00
2025-04-09 13:49:11 +02:00
2024-06-25 11:44:00 +02:00
2025-05-25 23:09:56 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%