[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Userdata and GC activity
- From: Javier Guerra Giraldez <javier@...>
- Date: Tue, 18 Nov 2008 06:15:38 -0500
On Tuesday 18 November 2008, Luiz Henrique de Figueiredo wrote:
> > When a statement is closed (either on the C or Lua side), the pointer
> > in its userdata object is nulled. All Lua wrappers check that it is
> > not null and error out.
> I usually remove the metatable from userdata objects that have been closed
> explicitly instead of storing NULL and checking.
almost as simple, and with nicer messages, would be to swap it with a
generic 'object closed' metadata.
but either of those approaches would fail if the Lua side has another
reference to an object method. In any case, the first thing the method has
to do is to check the object's type (or 'class'); and that should fail for a
Description: This is a digitally signed message part.