Re: Why table does not have the __gc event?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Why table does not have the __gc event?
- From: Edwin Eyan Moragas <haaktu@...>
- Date: 2006年1月16日 13:22:50 +0800
On 1/16/06, CHU Run-min <churunmin@gmail.com> wrote:
> Thanks, I understand it.
> But lua-5.1 manual seems confusing me. It says
>
> "Finalizers allow you to coordinate Lua's garbage collection with
> external resource management (such as closing files, network or
> database connections, or freeing your own memory). "
>
it simply means that whenever Lua collects garbage, it would also
call the __gc metamethods you have defined. this means you're also
leaving it up to the GC when it will clean up resources you have defined.
to mu understanding at least.
--
salud,
eyan
http://www.eyan.org