* This library provides an interface to the message queue to be used by other
* modules, especially intf modules. See config.h for output configuration.
*****************************************************************************
- * Copyright (C) 1998-2004 VideoLAN (Centrale Réseaux) and its contributors
+ * Copyright (C) 1998-2005 the VideoLAN team
* $Id$
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*/
void __msg_Flush( vlc_object_t *p_this )
{
- int i_index;
-
vlc_mutex_lock( &p_this->p_libvlc->msg_bank.lock );
p_this->p_libvlc->msg_bank.b_configured = VLC_TRUE;
+#if 0
+ /* Some messages remain in the queue, dont rewrite them */
for( i_index = p_this->p_libvlc->msg_bank.i_start;
i_index != p_this->p_libvlc->msg_bank.i_stop;
i_index = (i_index+1) % VLC_MSG_QSIZE )
{
PrintMsg( p_this, &p_this->p_libvlc->msg_bank.msg[i_index] );
}
+#endif
FlushMsg( &p_this->p_libvlc->msg_bank );
/* Remove this subscription */
REMOVE_ELEM( p_bank->pp_sub, p_bank->i_sub, i_index );
- free( p_sub );
-
+ if( p_sub ) free( p_sub );
vlc_mutex_unlock( &p_bank->lock );
}
if( p_bank->b_overflow )
{
- free( p_item->psz_module );
- free( p_item->psz_msg );
+ if( p_item->psz_module )
+ free( p_item->psz_module );
+ if( p_item->psz_msg )
+ free( p_item->psz_msg );
}
vlc_mutex_unlock( &p_bank->lock );
i_index != i_stop;
i_index = (i_index+1) % VLC_MSG_QSIZE )
{
- free( p_bank->msg[i_index].psz_msg );
- free( p_bank->msg[i_index].psz_module );
+ if( p_bank->msg[i_index].psz_msg )
+ free( p_bank->msg[i_index].psz_msg );
+ if( p_bank->msg[i_index].psz_module )
+ free( p_bank->msg[i_index].psz_module );
}
/* Update the new start value */