[vlc-devel] commit: One child is one reference ( Rémi Denis-Courmont )

Rémi Denis-Courmont rem at videolan.org
Sat Sep 20 21:33:06 CEST 2008


Le samedi 20 septembre 2008 22:09:40 Pierre d'Herbemont, vous avez écrit :
> On Sat, Sep 20, 2008 at 8:17 PM, git version control <git at videolan.org> 
wrote:
> > vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> |
> > Sat Sep 20 18:48:33 2008 +0300|
> > [559c876b10bf4391dc592cc5d21ae99124a4d5ec] | committer: Rémi
> > Denis-Courmont
> >
> > One child is one reference
> >
> > Avoid objects being detached asynchronously too early.
> > Side effect is that you cannot free your children in the destructor
> > (that would be a reference loop).
>
> I would yield() the child rather than the parent. Parent owns
> children, mostly because they created the children.

The parent needs to remain in the tree until the children is gone, for the 
sake of variables. As far as I can tell, the one and only point of the object 
tree is variables. Well, the other point is the (vomitive) vlc_object_find(), 
but that does not screw my point up anyway.

At the moment, destructors do not release a children anyway (not very clear 
with sout-keep). An object is supposed to release its children when its 
type-specific *_Destroy() function is invoked and/or as a side effect of 
vlc_object_kill() if there is no destroy function. That is supposed to be 
done independent of the reference count of the parent.

-- 
Rémi Denis-Courmont
http://git.remlab.net/cgi-bin/gitweb.cgi?p=vlc-courmisch.git;a=summary



More information about the vlc-devel mailing list