Commit a409380d authored by Pierre d'Herbemont's avatar Pierre d'Herbemont
Browse files

macosx: Make sure the manageIntf: Timer is getting cancelled at exit.

parent 7a4d005e
...@@ -307,6 +307,9 @@ struct intf_sys_t ...@@ -307,6 +307,9 @@ struct intf_sys_t
/* the manage thread */ /* the manage thread */
pthread_t manage_thread; pthread_t manage_thread;
/* The timer that update the interface */
NSTimer * interfaceTimer;
AppleRemote * o_remote; AppleRemote * o_remote;
BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */ BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
} }
......
...@@ -778,9 +778,9 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -778,9 +778,9 @@ static VLCMain *_o_sharedMainInstance = nil;
forMode: NSDefaultRunLoopMode]; forMode: NSDefaultRunLoopMode];
/* FIXME: don't poll */ /* FIXME: don't poll */
[NSTimer scheduledTimerWithTimeInterval: 0.5 interfaceTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.5
target: self selector: @selector(manageIntf:) target: self selector: @selector(manageIntf:)
userInfo: nil repeats: FALSE]; userInfo: nil repeats: FALSE] retain];
/* Note: we use the pthread API to support pre-10.5 */ /* Note: we use the pthread API to support pre-10.5 */
pthread_create( &manage_thread, NULL, ManageThread, self ); pthread_create( &manage_thread, NULL, ManageThread, self );
...@@ -1443,9 +1443,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1443,9 +1443,11 @@ static VLCMain *_o_sharedMainInstance = nil;
if( ((i_end_scroll != -1) && (mdate() > i_end_scroll)) || !p_input ) if( ((i_end_scroll != -1) && (mdate() > i_end_scroll)) || !p_input )
[self resetScrollField]; [self resetScrollField];
[NSTimer scheduledTimerWithTimeInterval: 0.3 [interfaceTimer autorelease];
interfaceTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.3
target: self selector: @selector(manageIntf:) target: self selector: @selector(manageIntf:)
userInfo: nil repeats: FALSE]; userInfo: nil repeats: FALSE] retain];
} }
- (void)setupMenus - (void)setupMenus
...@@ -1765,6 +1767,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1765,6 +1767,11 @@ static VLCMain *_o_sharedMainInstance = nil;
/* Make sure our manage_thread ends */ /* Make sure our manage_thread ends */
pthread_join( manage_thread, NULL ); pthread_join( manage_thread, NULL );
/* Make sure the interfaceTimer is destroyed */
[interfaceTimer invalidate];
[interfaceTimer release];
interfaceTimer = nil;
/* make sure that the current volume is saved */ /* make sure that the current volume is saved */
config_PutInt( p_intf->p_libvlc, "volume", i_lastShownVolume ); config_PutInt( p_intf->p_libvlc, "volume", i_lastShownVolume );
returnedValue = config_SaveConfigFile( p_intf->p_libvlc, "main" ); returnedValue = config_SaveConfigFile( p_intf->p_libvlc, "main" );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment