From e904f5987292811d623d4d0b58fd6b011845ef8f Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 25 Feb 2021 13:12:14 +0100 Subject: [PATCH] Assert that QWidgetPrivate::create creates a window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Change-Id: I4d5b8651b3510eff8e4a7b25889c0521ba6a4247 Reviewed-by: David Skoland Reviewed-by: Tor Arne Vestbø (cherry picked from commit 8cc72e0f634f1406a42c74b864914ccdfb3e58f3) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/kernel/qwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index b4be9bbfe76..99a6a24afff 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; }