summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <[email protected]>2024-02-05 15:22:51 +0100
committerQt Cherry-pick Bot <[email protected]>2024-02-06 12:15:44 +0000
commit8dfc8b440a26b0658a0bf8fb13105c5d16a13150 (patch)
tree68cefa13e44620552bd29e2b6efdc86e3cf1ae76
parent01dbb0a0afe622b0e6fcc1bb1d246ebf1ac47ea0 (diff)
iOS: Guard traitCollectionDidChange against lack of QGuiApplication
During shutdown we may get traitCollectionDidChange for our QUIWindow, as it may outlive the QGuiApplication and the QWindows due to hanging around in an auto-release pool. Change-Id: Ifc6471b933fb1b4d1e83e9b734aac31044dce03e Reviewed-by: Richard Moe Gustavsen <[email protected]> (cherry picked from commit 4dbc267945df841508a217fbdb6faf15c6f457fc) Reviewed-by: Qt Cherry-pick Bot <[email protected]> (cherry picked from commit 8543be735510d05bd7939d6bb7bb1f67cefda3f3) (cherry picked from commit 2050b400565cdcd9f8b53be9de53d31b18f18b86)
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index 67ab392fc14..55ae9aa2cdc 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -184,6 +184,9 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
{
[super traitCollectionDidChange:previousTraitCollection];
+ if (!qGuiApp)
+ return;
+
Qt::ColorScheme colorScheme = self.traitCollection.userInterfaceStyle
== UIUserInterfaceStyleDark
? Qt::ColorScheme::Dark