vlc_destructor_t pf_destructor )
{
vlc_object_internals_t *p_priv = vlc_internals(p_this );
+
+ vlc_spin_lock( &p_priv->ref_spin );
p_priv->pf_destructor = pf_destructor;
+ vlc_spin_unlock( &p_priv->ref_spin );
}
/**
if( b_should_destroy )
{
- /* We have no children */
- assert (internals->i_children == 0);
parent = p_this->p_parent;
#ifndef NDEBUG
if (parent)
/* Detach from parent to protect against FIND_CHILDREN */
vlc_object_detach_unlocked (p_this);
+
+ /* We have no children */
+ assert (internals->i_children == 0);
}
libvlc_unlock (p_this->p_libvlc);