Skip to content

Commit

Permalink
iOS dialog provider: fix retain cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
fkuehne committed Jun 19, 2015
1 parent 4f70ea7 commit 0a59bb7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/gui/ios_dialog_provider/dialogProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ + (NSDictionary *)dictionaryForDialog:(const char *)title :(const char *)message
[dict setObject:@(no) forKey:@"no"];
if (cancel)
[dict setObject:@(cancel) forKey:@"cancel"];
[dict retain];

return dict;
}
Expand All @@ -238,6 +239,7 @@ - (void)displayError:(NSDictionary *)dialog
VLCBlockingAlertView *alert = [[VLCBlockingAlertView alloc] initWithTitle:[dialog objectForKey:@"title"] message:[dialog objectForKey:@"message"] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
alert.completion = ^(BOOL cancelled, NSInteger buttonIndex) {
[alert release];
[dialog release];
};
[alert show];
}
Expand All @@ -249,6 +251,7 @@ - (void)displayCritical:(NSDictionary *)dialog
VLCBlockingAlertView *alert = [[VLCBlockingAlertView alloc] initWithTitle:[dialog objectForKey:@"title"] message:[dialog objectForKey:@"message"] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
alert.completion = ^(BOOL cancelled, NSInteger buttonIndex) {
[alert release];
[dialog release];
};
[alert show];
}
Expand Down Expand Up @@ -276,6 +279,7 @@ - (NSNumber *)displayQuestion:(NSDictionary *)dialog

dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
[alert release];
[dialog release];

return @(ret);
}
Expand Down Expand Up @@ -309,6 +313,7 @@ - (NSDictionary *)displayLogin:(NSDictionary *)dialog
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);

[alert release];
[dialog release];
return dict;
}

Expand Down

0 comments on commit 0a59bb7

Please sign in to comment.