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

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

parent 7a4d005e
......@@ -307,6 +307,9 @@ struct intf_sys_t
/* the manage thread */
pthread_t manage_thread;
/* The timer that update the interface */
NSTimer * interfaceTimer;
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 */
}
......
......@@ -778,9 +778,9 @@ static VLCMain *_o_sharedMainInstance = nil;
forMode: NSDefaultRunLoopMode];
/* FIXME: don't poll */
[NSTimer scheduledTimerWithTimeInterval: 0.5
interfaceTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.5
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 */
pthread_create( &manage_thread, NULL, ManageThread, self );
......@@ -1443,9 +1443,11 @@ static VLCMain *_o_sharedMainInstance = nil;
if( ((i_end_scroll != -1) && (mdate() > i_end_scroll)) || !p_input )
[self resetScrollField];
[NSTimer scheduledTimerWithTimeInterval: 0.3
[interfaceTimer autorelease];
interfaceTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.3
target: self selector: @selector(manageIntf:)
userInfo: nil repeats: FALSE];
userInfo: nil repeats: FALSE] retain];
}
- (void)setupMenus
......@@ -1765,6 +1767,11 @@ static VLCMain *_o_sharedMainInstance = nil;
/* Make sure our manage_thread ends */
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 */
config_PutInt( p_intf->p_libvlc, "volume", i_lastShownVolume );
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