* objects.c: vlc_object_t handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: objects.c,v 1.18 2002/08/14 17:06:53 sam Exp $
+ * $Id: objects.c,v 1.19 2002/08/15 12:11:15 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* vlc_liststructure: print the current vlc objects
*****************************************************************************
- * This function prints an ASCII tree showing the connections between vlc
- * objects, and additional information such as their refcount, thread ID,
- * address, etc.
+ * This function prints alist of vlc objects, and additional information such
+ * as their refcount, thread ID, etc.
*****************************************************************************/
void __vlc_liststructure( vlc_object_t *p_this )
{
* vlc_dumpstructure: print the current vlc structure
*****************************************************************************
* This function prints an ASCII tree showing the connections between vlc
- * objects, and additional information such as their refcount, thread ID,
- * address, etc.
+ * objects, and additional information such as their refcount, thread ID, etc.
*****************************************************************************/
void __vlc_dumpstructure( vlc_object_t *p_this )
{
* This function decreases the refcount of all objects in the list and
* frees the list.
*****************************************************************************/
-void __vlc_list_release( vlc_object_t *p_this, vlc_list_t *p_list )
+void vlc_list_release( vlc_list_t *p_list )
{
- vlc_object_t **p_current = p_list->pp_objects;
+ if( p_list->i_count )
+ {
+ vlc_t * p_vlc = p_list->pp_objects[0]->p_vlc;
+ vlc_object_t ** pp_current = p_list->pp_objects;
- vlc_mutex_lock( &p_this->p_vlc->structure_lock );
+ vlc_mutex_lock( &p_vlc->structure_lock );
- while( p_current[0] )
- {
- p_current[0]->i_refcount--;
- p_current++;
- }
+ while( pp_current[0] )
+ {
+ pp_current[0]->i_refcount--;
+ pp_current++;
+ }
- vlc_mutex_unlock( &p_this->p_vlc->structure_lock );
+ vlc_mutex_unlock( &p_vlc->structure_lock );
+ }
free( p_list );
}