diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2024-02-05 15:22:51 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2024-02-05 21:52:33 +0100 |
commit | 4dbc267945df841508a217fbdb6faf15c6f457fc (patch) | |
tree | b8500a1ecfbec0edc5f30f84002cf19e9191e98c | |
parent | 483523ad9f9807e84ab6aa0f48712df0524dbe28 (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.
Pick-to: 6.7 6.6 6.5
Change-Id: Ifc6471b933fb1b4d1e83e9b734aac31044dce03e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 65a8c21060..b54c696f3f 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -186,6 +186,9 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen) { [super traitCollectionDidChange:previousTraitCollection]; + if (!qGuiApp) + return; + Qt::ColorScheme colorScheme = self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? Qt::ColorScheme::Dark |