From b8dc2ab3b76d8a2d590126f28359620a156f62db Mon Sep 17 00:00:00 2001 From: Ehren Metcalfe Date: Wed, 11 May 2016 13:32:56 -0400 Subject: [PATCH 1/2] Fix ~ipad specific bundle loading (#488) ~ipad should be lower case. Also fixes setStartupDisplayMode: called too late (tablet mode must be configured to load ~ipad resources). --- Frameworks/Foundation/NSBundle.mm | 12 ++++++------ Frameworks/StarboardXaml/ApplicationMain.mm | 9 +++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Frameworks/Foundation/NSBundle.mm b/Frameworks/Foundation/NSBundle.mm index 94072f30ae..618e425b88 100644 --- a/Frameworks/Foundation/NSBundle.mm +++ b/Frameworks/Foundation/NSBundle.mm @@ -245,11 +245,11 @@ bool ScanFilename(BundleFile* dest, char* pDirectory, char* pFilename) { } dest->pszPlatform = copyWithoutExtension("~iphone", ""); szTemp[strlen(szTemp) - 7] = 0; - } else if (hasExtension(szTemp, "~iPad")) { + } else if (hasExtension(szTemp, "~ipad")) { if (!isTabletDevice()) { return false; } - dest->pszPlatform = copyWithoutExtension("~iPad", ""); + dest->pszPlatform = copyWithoutExtension("~ipad", ""); szTemp[strlen(szTemp) - 5] = 0; } @@ -867,9 +867,9 @@ - (NSString*)localizedStringForKey:(NSString*)key value:(NSString*)value table:( memmove(pPos, pPos + 7, strlen(pPos + 7) + 1); } } else { - if (strstr(szPath, "~iPad") != NULL) { - char* pPos = strstr(szPath, "~iPad"); - memmove(pPos, pPos + 4, strlen(pPos + 4) + 1); + if (strstr(szPath, "~ipad") != NULL) { + char* pPos = strstr(szPath, "~ipad"); + memmove(pPos, pPos + 5, strlen(pPos + 5) + 1); } } @@ -907,7 +907,7 @@ - (NSString*)localizedStringForKey:(NSString*)key value:(NSString*)value table:( if (!isTabletDevice()) { ret = makePath(self, name, extension, directory, localization, sublocal, @"~iphone"); } else { - ret = makePath(self, name, extension, directory, localization, sublocal, @"~iPad"); + ret = makePath(self, name, extension, directory, localization, sublocal, @"~ipad"); } path = (char*)[ret UTF8String]; diff --git a/Frameworks/StarboardXaml/ApplicationMain.mm b/Frameworks/StarboardXaml/ApplicationMain.mm index 86ac1a705a..f7b87f7f06 100644 --- a/Frameworks/StarboardXaml/ApplicationMain.mm +++ b/Frameworks/StarboardXaml/ApplicationMain.mm @@ -48,6 +48,11 @@ int ApplicationMainStart( WOCDisplayMode* displayMode = [UIApplication displayMode]; [displayMode _setWindowSize:CGSizeMake(windowWidth, windowHeight)]; + if ([UIApplication respondsToSelector:@selector(setStartupDisplayMode:)]) { + [UIApplication setStartupDisplayMode:displayMode]; + [displayMode _updateDisplaySettings]; + } + [NSBundle setMainBundlePath:@"."]; NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary]; @@ -95,10 +100,6 @@ int ApplicationMainStart( } #endif - if ([UIApplication respondsToSelector:@selector(setStartupDisplayMode:)]) { - [UIApplication setStartupDisplayMode:displayMode]; - } - [displayMode _updateDisplaySettings]; UIApplicationMainInit(argc, argv, principalClassName, delegateClassName, defaultOrientation); From 0f6d64045d4a9d07143cc32a009e739bcb81cc34 Mon Sep 17 00:00:00 2001 From: Samanthi Jeyaraj Date: Wed, 11 May 2016 19:51:20 -0400 Subject: [PATCH 2/2] Fixing memory leak in NSTextStorage. (#491) Fix #490 --- Frameworks/UIKit/NSTextStorage.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/Frameworks/UIKit/NSTextStorage.mm b/Frameworks/UIKit/NSTextStorage.mm index 19149b6068..dc9f0bb811 100644 --- a/Frameworks/UIKit/NSTextStorage.mm +++ b/Frameworks/UIKit/NSTextStorage.mm @@ -161,6 +161,7 @@ - (NSDictionary*)attributesAtIndex:(NSUInteger)location longestEffectiveRange:(N - (void)dealloc { [_layoutManagers release]; [_defaultAttributes release]; + [_composed release]; [super dealloc]; }