[vlc-devel] commit: macosx: Make sure we do call update on main thread. (Pierre d' Herbemont )

git version control git at videolan.org
Sun Jun 15 23:19:24 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Jun 15 23:07:07 2008 +0200| [7e7f3bd7530de33ee945ce6d893c85431369c477]

macosx: Make sure we do call update on main thread.

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

 modules/gui/macosx/update.m |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/update.m b/modules/gui/macosx/update.m
index e111cc8..4a0b8db 100644
--- a/modules/gui/macosx/update.m
+++ b/modules/gui/macosx/update.m
@@ -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




More information about the vlc-devel mailing list