lua-users home
lua-l archive

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


On 4/19/05, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> Since this userdata is dummy anyway, you can store the table as the
> userdata's metatable. Lua 5.1 offers a more proper way to do this
> mapping.
> 
> But I think Luacom already builds userdata to represent COM objects,
> doesn't it? Can't you attach the __gc on them?

LuaCOM uses a table with a userdata in one of its keys. The key is
_USERDATA_REF. These userdata already have a metatable with __gc (to
call Release on the COM object, among other things). So if you change
the metatable, remember to call the original __gc.
 
> -- Roberto
> 

--
Fabio Mascarenhas