]> git.sesse.net Git - vlc/blobdiff - src/misc/objects.c
* Do not take and release the structure lock for each element of the list while
[vlc] / src / misc / objects.c
index cc78ee9f66e881420591b5dc018853c806f3f82c..66599191cd82fdb58d82a4c749719bd192497ce9 100644 (file)
@@ -852,14 +852,12 @@ void vlc_list_release( vlc_list_t *p_list )
 {
     int i_index;
 
+    vlc_mutex_lock( &structure_lock );
     for( i_index = 0; i_index < p_list->i_count; i_index++ )
     {
-        vlc_mutex_lock( &structure_lock );
-
         p_list->p_values[i_index].p_object->i_refcount--;
-
-        vlc_mutex_unlock( &structure_lock );
     }
+    vlc_mutex_unlock( &structure_lock );
 
     free( p_list->p_values );
     free( p_list );