[matroska-devel] Re: Memory leaks in libmatroska partially fixed
rbultje at ronald.bitfreak.net
Tue Feb 25 17:03:18 CET 2003
On Tue, 2003-02-25 at 16:26, Steve Lhomme wrote:
> Something like a garbage collector ?
Well, sort of, but much simpler.
> That could work if we trapped all allocation and check for unfreed but
> referenced element at the end. I'm not sure it would prevent more bugs. If
> someone forget to ref/unref an element for example. While locking seems more formal.
The same goes for memory allocating per se. Forgetting to free causes
mem leaks. The point is that refcounting actually allows proper sharing
of resources between elements without having the risk of using
unreferenced (already free()ed) pointers. Having "just" one owner that
free's the thing is more dangerous and limiting, imo.
Ronald Bultje <rbultje at ronald.bitfreak.net>
Linux Video/Multimedia developer
More information about the Matroska-devel