[vlc-devel] commit: Implement access_GetParentInput and demux_GetParentInput and use. ( Pierre d'Herbemont )
remi at remlab.net
Wed Aug 26 17:12:27 CEST 2009
Le mercredi 26 août 2009 17:42:01 Pierre d'Herbemont, vous avez écrit :
> First, demux and access don't properly implement refcounting. If
> someone is holding a reference to it, its data might get destroyed,
> and lead to crash for free.
How so? To my knowledge *none* of the demux_t and access_t specific members
are thread-safe. So none of them should be accessed from
vlc_object_find(_name). So none of them need to be reference-counted.
> (They should implement a destructor or set
> at list its destroyed instance variable to NULL).
A destructor is only useful when you have some type-specific data to be
accessed through the object tree. Then you need to destroy it only when the
reference count drops to zero. Most types don't, so a type-specific destroy
function is sufficient, which is called by the "owner" of the object.
More information about the vlc-devel