lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Tue, Feb 20, 2018, at 20:46, Roberto Ierusalimschy wrote:
> > - Several code examples in PiL will leak resources if allocation fails,
> >   e.g. the readdir example in listing 29.1 will leak the directory handler.
> The readdir example is clear about its leak, and the book presents another
> (and better, in my view) implementation that does not leak. I would like
> to know about the other code examples that leak resources.

I'm sorry, that's true, I forgot about that, and I'm not even sure there
are other examples that leak anything in PiL.

For memory, PiL typically uses userdata or luaL_Buffer and not plain
malloc, which avoids the problem.

Pierre Chapuis