]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/intf.m
macosx: Update progress dialog on the main thread, make check thread safe
[vlc] / modules / gui / macosx / intf.m
index db4e72149fe4e2158aeb887a77679b2241044884..7ff668c158815214990040f08f24fb80c3fe5b8f 100644 (file)
@@ -524,13 +524,10 @@ void updateProgressPanel (void *priv, const char *text, float value)
 {
     NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
 
-    NSString *o_txt;
-    if (text != NULL)
-        o_txt = [NSString stringWithUTF8String:text];
-    else
-        o_txt = @"";
-
-    [[[VLCMain sharedInstance] coreDialogProvider] updateProgressPanelWithText: o_txt andNumber: (double)(value * 1000.)];
+    NSString *o_txt = toNSStr(text);
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [[[VLCMain sharedInstance] coreDialogProvider] updateProgressPanelWithText: o_txt andNumber: (double)(value * 1000.)];
+    });
 
     [o_pool release];
 }