lua-users home
lua-l archive

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


The object is pushed as (heavy) Lua userdata. This means that Lua
keeps a reference to the C object. If you want, you can ask tolua
(through the 'takeownership' function) to delete the C object whenever
Lua collects the corresponding userdata.

-- Waldemar

On Nov 9, 2009, at 2:05 PM, zweifel wrote:

Hello guys,

I would like to know how exactly the memory management in tolua_pushusertype() works. I was expecting that my information was passed as tables to my lua script and that would be I could without problems delete my structs in C. But that does not hold truth, because after deleting the data in C the scripts stopped working.

I looked also that tolua uses a begin_module() to define the classes, but I am not sure how this works either and I was not able to find it on the net.

Could you provide me some information in how does this work or where to obtain information.

Thanks,
Danilo