lua-users home
lua-l archive

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


> > 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