[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: checking userdata type from lua
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 18 May 2006 09:58:44 -0300
> > Yes, but the metatable for the type is stored in the registry and I
> > thought that was only accessible from the C API.
>
> Sure, you'd have to make it accessible from Lua as well, maybe in
> a global table.
That's dangerous. If you expose the registry, you can turn a udata from
one type to another. So you could convert a button to a file and then
call close on it, which will probably crash the host app.
--lhf