lua-users home
lua-l archive

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

> For the other problem, since I just used a userdata containing a
> pointer, the destructor just zeroes this. Other functions will see
> that as a NULL pointer. If you are wrapping some API you should add
> the check to the wrappers.

Another way, which I use in some of my libraries, is just to remove the
metatable in the explicit destructor or close. In this way, you can use
the close method as the method.