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:
parent
3d4a2241b9
commit
d6327d5dc8
@ -58,7 +58,7 @@
|
||||
|
||||
@interface QIOSViewController () {
|
||||
@public
|
||||
QIOSScreen *m_screen;
|
||||
QPointer<QIOSScreen> 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
|
||||
|
Loading…
Reference in New Issue
Block a user