lua-users home
lua-l archive

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


Does this mean that garbage collection for toLua-generated objects/userdata
will leak? Is there a workaround?

Eric

> -----Original Message-----
> From: owner-lua-l@tecgraf.puc-rio.br
> [mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of Roberto
> Ierusalimschy
> Sent: Wednesday, May 02, 2001 5:09 PM
> To: Multiple recipients of list
> Subject: Re: tolua memory leak?
>
>
>   int gc_tagmethod(lua_State* L) {
>     lua_pushuserdata(L, (void*) 0xbeef);  // leak is a
> side-effect from here!
>     lua_pop(L, 1);
>     return 0;
>
> This is a "deficiency" of Lua. You cannot create new Lua objects during
> a gc tagmethod (that is why we restricted the use of gc tagmethods in
> later versions). But I am afraid the manual has a bug of not stating
> this restriction clearly.
>
> -- Roberto