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

macosx: Make sure we don't leak an input_thread_t.

parent b0d34dd0
...@@ -67,9 +67,6 @@ struct intf_sys_t ...@@ -67,9 +67,6 @@ struct intf_sys_t
{ {
NSAutoreleasePool * o_pool; NSAutoreleasePool * o_pool;
/* the current input */
input_thread_t * p_input;
/* special actions */ /* special actions */
bool b_mute; bool b_mute;
int i_play_status; int i_play_status;
......
...@@ -1132,6 +1132,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1132,6 +1132,7 @@ static VLCMain *_o_sharedMainInstance = nil;
- (void)manage - (void)manage
{ {
playlist_t * p_playlist; playlist_t * p_playlist;
input_thread_t * p_input = NULL;
/* new thread requires a new pool */ /* new thread requires a new pool */
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
...@@ -1153,25 +1154,25 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1153,25 +1154,25 @@ static VLCMain *_o_sharedMainInstance = nil;
{ {
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
if( p_intf->p_sys->p_input == NULL ) if( !p_input )
{ {
p_intf->p_sys->p_input = playlist_CurrentInput( p_playlist ); p_input = playlist_CurrentInput( p_playlist );
/* Refresh the interface */ /* Refresh the interface */
if( p_intf->p_sys->p_input ) if( p_input )
{ {
msg_Dbg( p_intf, "input has changed, refreshing interface" ); msg_Dbg( p_intf, "input has changed, refreshing interface" );
p_intf->p_sys->b_input_update = true; p_intf->p_sys->b_input_update = true;
} }
} }
else if( !vlc_object_alive (p_intf->p_sys->p_input) || p_intf->p_sys->p_input->b_dead ) else if( !vlc_object_alive (p_input) || p_input->b_dead )
{ {
/* input stopped */ /* input stopped */
p_intf->p_sys->b_intf_update = true; p_intf->p_sys->b_intf_update = true;
p_intf->p_sys->i_play_status = END_S; p_intf->p_sys->i_play_status = END_S;
msg_Dbg( p_intf, "input has stopped, refreshing interface" ); msg_Dbg( p_intf, "input has stopped, refreshing interface" );
vlc_object_release( p_intf->p_sys->p_input ); vlc_object_release( p_input );
p_intf->p_sys->p_input = NULL; p_input = NULL;
} }
/* Manage volume status */ /* Manage volume status */
...@@ -1184,6 +1185,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1184,6 +1185,8 @@ static VLCMain *_o_sharedMainInstance = nil;
vlc_object_unlock( p_intf ); vlc_object_unlock( p_intf );
[o_pool release]; [o_pool release];
if( p_input ) vlc_object_release( p_input );
var_DelCallback( p_playlist, "playlist-current", PlaylistChanged, self ); var_DelCallback( p_playlist, "playlist-current", PlaylistChanged, self );
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, self ); var_DelCallback( p_playlist, "intf-change", PlaylistChanged, self );
var_DelCallback( p_playlist, "item-change", PlaylistChanged, self ); var_DelCallback( p_playlist, "item-change", PlaylistChanged, self );
......
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