[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __gc visible to lua code...
- From: Javier Guerra <javier@...>
- Date: Fri, 30 Mar 2007 20:01:55 -0500
On Friday 30 March 2007, Graham Wakefield wrote:
> Well there's no harm having a close method; so long as it makes sense
> to retain a LuaSQL userdata reference that is no longer connected.
> Otherwise, I thought setting the userdata to nil would be the
> equivalent.
sometimes you want an immediate close, not wait until the GC decides it needs
to collect the userdata.
also, remember that the GC only counts the memory used by the userdata itself;
the backend library might use a lot more resources unaccounted by the GC.
usually having a close() is a good idea
--
Javier
Attachment:
pgpTvFRRobHu2.pgp
Description: PGP signature