]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/update.m
update: Various fixes to make it work on Mac OS X.
[vlc] / modules / gui / macosx / update.m
index 4346af3b09893fa7658a21cb4cc80ca28122b53e..88ed6bd755596489bb4b6e9fc87f0e59d2bb239d 100644 (file)
@@ -151,7 +151,7 @@ static VLCUpdate *_o_sharedInstance = nil;
     if( returnCode == NSOKButton )
     {
         /* perform download and pass the selected path */
-        [self performDownload: [sheet filename]];
+        [NSThread detachNewThreadSelector:@selector(performDownload:) toTarget:self withObject:[sheet filename]];
     }
     [sheet release];
 }
@@ -215,11 +215,14 @@ static void updateCallback( void * p_data, bool b_success )
 
 - (void)performDownload:(NSString *)path
 {
+    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
     update_Download( p_u, [path UTF8String] );
     [o_btn_DownloadNow setEnabled: NO];
     [o_update_window orderOut: self];
+    update_WaitDownload( p_u );
     update_Delete( p_u );
     p_u = nil;
+    [pool release];
 }
 
 @end