[vlc-devel] commit: Destroy the playlist AFTER looking for a sout attached to it ( Rafaël Carré )

Rémi Denis-Courmont rdenis at simphalempin.com
Mon May 19 19:07:13 CEST 2008


Le Monday 19 May 2008 19:47:42 Pierre d'Herbemont, vous avez écrit :
> If you own:
>
> p_obj (refcount = 1+2)
> 	p_child1
> 	p_child2
>
> vlc_object_release( p_obj ) -> you can never reach the destructor.

> If you want the refcount to reach 0, you have to call something like
> vlc_release_children( p_obj ). So basically, this solve our problem by
> expecting the object owners to explicitely know when the object
> refcount reaches i_children, and explicitely release children
> accordingly. This seems a bit flawed, regarding to the advantages of
> refcounting.

Actually, I wonder how 4 would work at all. What if another thread yields the 
object back to i_refcount > i_children before all children are detached? You 
could end up running the destructor multiple times - not good. In fact, this 
is precisely what's going to happen if a children does FIND_PARENT.

Or I don't understand what you're trying to do.

(...)
> By the way, I really think that we are fine as we are. We just need to
> remove that hierarchy :)

We still need the hierarchy for variables inheritance, AFAIK.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list