iOS: Track QIOSViewController -> QIOSScreen using QPointer

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 <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Tor Arne Vestbø 2015-01-20 16:17:12 +01:00 committed by Tor Arne Vestbø
parent 3d4a2241b9
commit d6327d5dc8

View File

@ -58,7 +58,7 @@
@interface QIOSViewController () {
@public
QIOSScreen *m_screen;
QPointer<QIOSScreen> m_screen;
BOOL m_updatingProperties;
QMetaObject::Connection m_focusWindowChangeConnection;
}
@ -334,6 +334,7 @@
if (!QCoreApplication::instance())
return;
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