Commit 4884854b authored by Rémi Duraffort's avatar Rémi Duraffort

update: fix objects leak.

parent e0a09aa3
......@@ -1381,6 +1381,14 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void
{
assert( p_update );
// If the object already exist, destroy it
if( p_update->p_check )
{
vlc_object_kill( p_update->p_check );
vlc_thread_join( p_update->p_check );
vlc_object_release( p_update->p_check );
}
update_check_thread_t *p_uct =
vlc_custom_create( p_update->p_libvlc, sizeof( *p_uct ),
VLC_OBJECT_GENERIC, "update check" );
......@@ -1473,10 +1481,12 @@ static char *size_str( long int l_size )
void update_WaitDownload( update_t *p_update )
{
if(p_update->p_download)
if( p_update->p_download )
{
vlc_thread_join( p_update->p_download );
vlc_object_release( p_update->p_download );
p_update->p_download = NULL;
}
}
static void* update_DownloadReal( vlc_object_t *p_this );
......@@ -1494,6 +1504,14 @@ void update_Download( update_t *p_update, const char *destination )
{
assert( p_update );
// If the object already exist, destroy it
if( p_update->p_download )
{
vlc_object_kill( p_update->p_download );
vlc_thread_join( p_update->p_download );
vlc_object_release( p_update->p_download );
}
update_download_thread_t *p_udt =
vlc_custom_create( p_update->p_libvlc, sizeof( *p_udt ),
VLC_OBJECT_GENERIC, "update download" );
......
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