{
vlc_object_internals_t *p_priv = vlc_internals( p_this );
+ /* Automatically detach the object from its parents */
+ if( p_this->p_parent ) vlc_object_detach( p_this );
+
/* Sanity checks */
if( p_this->i_children )
{
abort();
}
- if( p_this->p_parent )
- {
- fprintf( stderr,
- "ERROR: cannot delete object (id:%i, type:%s, name:%s) "
- "with a parent (id:%i, type:%s, name:%s)\n",
- p_this->i_object_id, p_this->psz_object_type,
- p_this->psz_object_name, p_this->p_parent->i_object_id,
- p_this->p_parent->psz_object_type,
- p_this->p_parent->psz_object_name );
- fflush(stderr);
- abort();
- }
-
/* Call the custom "subclass" destructor */
if( p_priv->pf_destructor )
p_priv->pf_destructor( p_this );
vlc_mutex_lock( &structure_lock );
- /* Avoid obvious freed object uses */
- assert( p_this->p_internals->i_refcount > 0 );
-
if( !p_this->p_parent )
{
msg_Err( p_this, "object is not attached" );