[vlc-devel] commit: Fix memleak (should fix #1081) ( Rémi ?Duraffort )
Rémi Denis-Courmont
rdenis at simphalempin.com
Mon Aug 25 08:05:54 CEST 2008
On Mon, 25 Aug 2008 02:09:11 +0200, Pierre d'Herbemont
<pdherbemont at free.fr> wrote:
> Passing ownership to caller is counter intuitive. But I guess fixing
> that properly would mean implementing refcounting.
Passing ownership to a caller is what you always (sort of) do when you give
a non-const reference to anything. We can argue that the buffer management
in VLC is too inflexible. Indeed, it does not handle sharing buffers. But
the calling convention looks pretty sane to me. In the Linux kernel, you
also give a reference to the sk_buff when you invoke someone's else
callback... Frankly, I cannot see how anything could work (in a
multi-tasked programming environment) other than this way.
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list