From 78fec3372ad819cc93b9cfb5bd3df2da6d792cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 25 Dec 2012 21:55:10 +0100 Subject: [PATCH] iOS: Auto-release the UIWindow and root view-controller They are retained properties. Change-Id: Id1808d93fe30950fc05e41375f00183e098bff0b Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qtmain.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/ios/qtmain.mm b/src/plugins/platforms/ios/qtmain.mm index 7cc96f54b1..04151cd720 100644 --- a/src/plugins/platforms/ios/qtmain.mm +++ b/src/plugins/platforms/ios/qtmain.mm @@ -55,10 +55,9 @@ extern int qt_main(int argc, char *argv[]); - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - QIOSViewController *controller = [[QIOSViewController alloc] init]; - self.window.rootViewController = controller; - controller.view = [[UIView alloc] init]; + self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; + self.window.rootViewController = [[[QIOSViewController alloc] init] autorelease]; + self.window.rootViewController.view = [[UIView alloc] init]; // Aid debugging during development self.window.backgroundColor = [UIColor cyanColor];