summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-25 13:12:14 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-25 17:11:09 +0100
commit8cc72e0f634f1406a42c74b864914ccdfb3e58f3 (patch)
treee7781cb100a4eb3099e787095e4c2ef704017f32 /src/widgets/kernel/qwidget.cpp
parent4da0060ca8022b9b1a7660614545590034843d09 (diff)
Assert that QWidgetPrivate::create creates a window
Assert the expected side effect of createTLSysExtra, which might not allocate a window, but must do so in this case (as we have already returned if the QWidget is not a window). Fixes static analyzer warning 2f3bbfe8addb586445e96f8906d6769e Pick-to: 6.1 Change-Id: I4d5b8651b3510eff8e4a7b25889c0521ba6a4247 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r--src/widgets/kernel/qwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index b4be9bbfe7..99a6a24aff 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1246,6 +1246,7 @@ void QWidgetPrivate::create()
// in case the extra was already valid.
if (!win) {
createTLSysExtra();
+ Q_ASSERT(topData()->window);
win = topData()->window;
}