iOS: Handle an QIOSViewController outliving its related QIOSScreen

We release the UIWindow that retains QIOSViewController in the
QIOSScreen destructor, but other parts of the OS may have retained
the view controller, so the dealloc may not happen until later. In
the meantime we may receive calls to shouldAutorotate, so we need to
guard this code for the situation that m_screen has been deleted.

Change-Id: Iefeb75f4fc698b5e80417ffd3a971b7de625bcd5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
This commit is contained in:
Tor Arne Vestbø 2015-03-09 19:30:10 +01:00
parent 3ce88e13b9
commit 4c542ab592

View File

@ -238,7 +238,7 @@
-(BOOL)shouldAutorotate
{
return m_screen->uiScreen() == [UIScreen mainScreen] && !self.lockedOrientation;
return m_screen && m_screen->uiScreen() == [UIScreen mainScreen] && !self.lockedOrientation;
}
#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_6_0)