Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-26111] iOS: Fix all static analyzer warnings and possible leaks #10098

Merged
merged 10 commits into from Jun 13, 2018
2 changes: 1 addition & 1 deletion iphone/Classes/APIModule.m
Expand Up @@ -26,8 +26,8 @@ - (NSString *)apiName
- (void)logMessage:(NSArray *)args severity:(NSString *)severity
{

NSString *lcSeverity = [severity lowercaseString];
#ifndef USE_JSCORE_FRAMEWORK
NSString *lcSeverity = [severity lowercaseString];
DebuggerLogLevel level = OUT;
if ([lcSeverity isEqualToString:@"warn"]) {
level = WARN;
Expand Down
1 change: 1 addition & 0 deletions iphone/Classes/CalendarModule.m
Expand Up @@ -119,6 +119,7 @@ - (NSArray *)allEditableCalendars
if ([calendar_ allowsContentModifications]) {
TiCalendarCalendar *calendar = [[TiCalendarCalendar alloc] _initWithPageContext:[self executionContext] calendar:calendar_ module:self];
[editableCalendars addObject:calendar];
RELEASE_TO_NIL(calendar);
}
}
return editableCalendars;
Expand Down
4 changes: 1 addition & 3 deletions iphone/Classes/TiApp.m
Expand Up @@ -1165,10 +1165,8 @@ - (void)applicationWillEnterForeground:(UIApplication *)application
#pragma mark Handoff Delegates

#ifdef USE_TI_APPIOS
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *_Nullable))restorationHandler
{

NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:@{ @"activityType" : [userActivity activityType] }];

if ([TiUtils isIOS9OrGreater] && [[userActivity activityType] isEqualToString:CSSearchableItemActionType]) {
Expand Down
7 changes: 6 additions & 1 deletion iphone/Classes/TiAppiOSProxy.m
Expand Up @@ -699,10 +699,15 @@ - (id)scheduleLocalNotification:(id)args
ENSURE_ARG_FOR_KEY(_url, attachment, @"url", NSString);
ENSURE_ARG_OR_NIL_FOR_KEY(_options, attachment, @"options", NSDictionary);

NSDictionary *nativeOptions = _options != nil ? [[self formatNotificationAttachmentOptions:_options] retain] : nil;

UNNotificationAttachment *_attachment = [UNNotificationAttachment attachmentWithIdentifier:_identifier
URL:[TiUtils toURL:_url proxy:self]
options:[[self formatNotificationAttachmentOptions:_options] retain]
options:nativeOptions
error:&error];

RELEASE_TO_NIL(nativeOptions);

if (error != nil) {
DebugLog(@"[ERROR] Attachment with the identifier = \"%@\" is invalid: %@", _identifier, [error localizedDescription]);
} else {
Expand Down