qt6-bb10/tests/auto
Tor Arne Vestbø 12203e94f5 QWidget: Clean up state that depends on QWindow from ~QWidgetWindow()
We were assuming that QWidget was in full control of QWidgetWindow
destruction, via deleteTLSysExtra(), and that we could limit any
cleanups to that function.

But in some situations QWidgetWindow is destructed from other code paths,
in which case we were left with dangling pointers to the QWidgetWindow
in both QTLWExtra, as well as the backingstore.

This can happen if there's a child widget hierarchy where there is not
a 1:1 mapping between QWidgets and QWindows, for example if the window
attribute WA_DontCreateNativeAncestors has been set. In this situation
our normal recursion into children in QWidget::destroy() stops at the
first widget without a window handle. When we then delete the top level
QWindow, the QWindow destructor will delete any child QWindows, which
includes our leaf QWidgetWindow.

We should probably fix up QWidget::destroy to continue looking for
children, even if we don't destroy the current child. But independently
of that we should make sure the QWidgetWindow cleans up when it's being
deleted, regardless of how it ended up there.

There's further room to clean up the deleteTLSysExtra() function and
friends, but that's been left for a later time.

Fixes: QTBUG-120509
Pick-to: 6.7 6.6 6.6.2 6.5
Change-Id: Ib691df164d7c9c83cb464c0a6bf3bc2116e8ca43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-23 12:56:54 +00:00
..
bic/data Add binary compatibility file for 6.6.0 2023-10-17 22:23:42 +03:00
cmake qt6_wrap_cpp: Add .moc generation 2024-01-19 16:16:51 +01:00
concurrent Fix QThreadPool::maxThreadCount() usage 2024-01-08 18:29:26 +01:00
corelib QJniArray: add test case for QJniArray::size 2024-01-23 13:56:54 +01:00
dbus QDBusConnectionPrivate: Close connection after failed q_dbus_bus_register() 2023-12-07 23:36:15 +01:00
gui QTextImageHandler: Use QUrl::toLocalFile to convert to local file name 2024-01-21 09:12:33 +00:00
guiapplauncher Turn the "concentriccircles" example into snippets, update screenshot 2023-12-14 20:06:32 +01:00
network Remove QHttpHeaders::names() 2024-01-20 03:35:32 +00:00
opengl tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
other Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
printsupport Dialogs: clean up native dialogs when object gets destroyed 2023-09-06 23:12:33 +02:00
shared coretext: Support variable application fonts 2023-10-03 19:25:46 +02:00
sql SQL: rename enablePositionalBinding() to setPositionalBindingEnabled() 2024-01-10 04:32:49 +01:00
testlib Fix some -Wunused-* warnings on MinGW 2024-01-10 09:45:48 +01:00
tools tst_moc: fix some -Wunused-* warnings on MinGW 2024-01-10 09:45:48 +01:00
wasm wasm tests: Add test for making network request 2023-12-19 17:05:55 +00:00
widgets QWidget: Clean up state that depends on QWindow from ~QWidgetWindow() 2024-01-23 12:56:54 +00:00
xml CMake: Make qtbase tests standalone projects 2023-07-05 15:09:32 +02:00
CMakeLists.txt CI: Enable some tests under corelib/thread for Wasm platform 2023-09-14 11:58:48 +02:00
network-settings.h QtNetworkSettings: narrow down hasIPv6 to specific OSes 2023-08-29 07:20:51 -07:00