iOS: Disconnect focusWindowChanged connection on QIOSViewController dealloc

Change-Id: I6acac4c926fcf5459364133b6cc58baff0519074
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
bb10
Tor Arne Vestbø 2015-01-21 13:57:16 +01:00 committed by Tor Arne Vestbø
parent f568e511b7
commit 087c61f7b7
1 changed files with 8 additions and 1 deletions

View File

@ -60,6 +60,7 @@
@public
QIOSScreen *m_screen;
BOOL m_updatingProperties;
QMetaObject::Connection m_focusWindowChangeConnection;
}
@property (nonatomic, assign) BOOL changingOrientation;
@end
@ -202,7 +203,7 @@
self.prefersStatusBarHidden = infoPlistValue(@"UIStatusBarHidden", false);
self.preferredStatusBarUpdateAnimation = UIStatusBarAnimationNone;
QObject::connect(qApp, &QGuiApplication::focusWindowChanged, [self]() {
m_focusWindowChangeConnection = QObject::connect(qApp, &QGuiApplication::focusWindowChanged, [self]() {
[self updateProperties];
});
}
@ -210,6 +211,12 @@
return self;
}
- (void)dealloc
{
QObject::disconnect(m_focusWindowChangeConnection);
[super dealloc];
}
- (void)loadView
{
self.view = [[[QIOSDesktopManagerView alloc] init] autorelease];