X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Fobjects.c;h=eea00ba1176f60d1277cb02f464c39479d4f6404;hb=a27e683aff0ebf1c076f014a319f66eb227217ac;hp=3f551900d97d9eb0a88d9c31e61e3d3f0cda9cc1;hpb=4c2ec0499295ca1b305b5aa1b5a3b372c200f3aa;p=vlc diff --git a/src/misc/objects.c b/src/misc/objects.c index 3f551900d9..eea00ba117 100644 --- a/src/misc/objects.c +++ b/src/misc/objects.c @@ -205,18 +205,10 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type ) switch( i_type ) { - case VLC_OBJECT_INTF: - i_size = sizeof(intf_thread_t); - psz_type = "interface"; - break; case VLC_OBJECT_DECODER: i_size = sizeof(decoder_t); psz_type = "decoder"; break; - case VLC_OBJECT_PACKETIZER: - i_size = sizeof(decoder_t); - psz_type = "packetizer"; - break; case VLC_OBJECT_AOUT: i_size = sizeof(aout_instance_t); psz_type = "audio output"; @@ -245,7 +237,10 @@ void __vlc_object_set_destructor( vlc_object_t *p_this, 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 ); } /** @@ -572,8 +567,6 @@ void __vlc_object_release( vlc_object_t *p_this ) if( b_should_destroy ) { - /* We have no children */ - assert (internals->i_children == 0); parent = p_this->p_parent; #ifndef NDEBUG @@ -607,6 +600,9 @@ void __vlc_object_release( vlc_object_t *p_this ) 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);