]> git.sesse.net Git - vlc/blobdiff - src/misc/objects.c
Fixed VP31 in NSV files.
[vlc] / src / misc / objects.c
index 3f551900d97d9eb0a88d9c31e61e3d3f0cda9cc1..b872f3f0feac8495fa3b8016a75e5205b9600946 100644 (file)
@@ -245,7 +245,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 +575,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 +608,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);