[vlc-commits] iOS dialog provider: fix retain cycle

Felix Paul Kühne git at videolan.org
Fri Jun 19 15:27:47 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Jun 19 15:27:08 2015 +0200| [0a59bb70bb494cdd47df6d7edbd85d00e4864152] | committer: Felix Paul Kühne

iOS dialog provider: fix retain cycle

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0a59bb70bb494cdd47df6d7edbd85d00e4864152
---

 modules/gui/ios_dialog_provider/dialogProvider.m |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/gui/ios_dialog_provider/dialogProvider.m b/modules/gui/ios_dialog_provider/dialogProvider.m
index 8b9e1f8..9deacf2 100644
--- a/modules/gui/ios_dialog_provider/dialogProvider.m
+++ b/modules/gui/ios_dialog_provider/dialogProvider.m
@@ -226,6 +226,7 @@ static int DisplayLogin(vlc_object_t *p_this, const char *type, vlc_value_t prev
         [dict setObject:@(no) forKey:@"no"];
     if (cancel)
         [dict setObject:@(cancel) forKey:@"cancel"];
+    [dict retain];
 
     return dict;
 }
@@ -238,6 +239,7 @@ static int DisplayLogin(vlc_object_t *p_this, const char *type, vlc_value_t prev
     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];
 }
@@ -249,6 +251,7 @@ static int DisplayLogin(vlc_object_t *p_this, const char *type, vlc_value_t prev
     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];
 }
@@ -276,6 +279,7 @@ static int DisplayLogin(vlc_object_t *p_this, const char *type, vlc_value_t prev
 
     dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
     [alert release];
+    [dialog release];
 
     return @(ret);
 }
@@ -309,6 +313,7 @@ static int DisplayLogin(vlc_object_t *p_this, const char *type, vlc_value_t prev
     dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
 
     [alert release];
+    [dialog release];
     return dict;
 }
 



More information about the vlc-commits mailing list