From d6327d5dc81ae2e9da69665365226786c777ddc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 20 Jan 2015 16:17:12 +0100 Subject: iOS: Track QIOSViewController -> QIOSScreen using QPointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We may receive viewWillLayoutSubviews calls for the view controller even if QIOSScreen has released the UIWindow that retains the view controller. Change-Id: I0cc7c50dbb5ee00224aec46d070b04efe069e85a Reviewed-by: Richard Moe Gustavsen Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosviewcontroller.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/ios') diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index ee36c3f3a8..1e1ac4ba18 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -58,7 +58,7 @@ @interface QIOSViewController () { @public - QIOSScreen *m_screen; + QPointer m_screen; BOOL m_updatingProperties; QMetaObject::Connection m_focusWindowChangeConnection; } @@ -334,7 +334,8 @@ if (!QCoreApplication::instance()) return; - m_screen->updateProperties(); + if (m_screen) + m_screen->updateProperties(); } // ------------------------------------------------------------------------- @@ -344,7 +345,7 @@ if (!isQtApplication()) return; - if (!m_screen->screen()) + if (!m_screen || !m_screen->screen()) return; // For now we only care about the main screen, as both the statusbar -- cgit v1.2.3