]> git.sesse.net Git - vlc/commitdiff
macosx: Make sure we do call update on main thread.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 15 Jun 2008 21:07:07 +0000 (23:07 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 15 Jun 2008 21:07:07 +0000 (23:07 +0200)
modules/gui/macosx/update.m

index e111cc87ac02fcd957438dc171441598117ed11f..4a0b8dbe9ec20b0ced56bc0addd026e9bf207042 100644 (file)
@@ -169,8 +169,6 @@ static VLCUpdate *_o_sharedInstance = nil;
 
 - (void)setUpToDate:(BOOL)uptodate
 {
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
     if( uptodate )
     {
         [o_fld_releaseNote setString: @""];
@@ -192,13 +190,15 @@ static VLCUpdate *_o_sharedInstance = nil;
         [o_update_window displayIfNeeded];
         [o_update_window makeKeyAndOrderFront: self];
     }
-
-    [pool release];
 }
 
 static void updateCallback( void * p_data, bool b_success )
 {
-    [(id)p_data setUpToDate: !b_success || !update_NeedUpgrade( ((VLCUpdate*)p_data)->p_u )];
+    VLCUpdate * update = p_data;
+    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+    NSNumber * state = [NSNumber numberWithBool:!b_success || !update_NeedUpgrade( update->p_u )];
+    [update performSelectorOnMainThread:@selector(setUpToDate:) withObject:state waitUntilDone:YES];
+    [pool release];
 }
 
 - (void)checkForUpdate