lua-users home
lua-l archive

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


Ok, I've got it :)

Found the answer in the tolua reference: For explicitely constructed objects I have to call e.g. test:delete() by myself.

Best Regards
Michael

Michael Bauroth schrieb:
Hi,

I'm working with Lua for about 2 months. The underlying core is written in C++. Both worlds are connected over tolua. All the stuff works pretty well and stable.

Today I've checked the part of garbage collection with

collectgarbage ( "collect" )
collectgarbage ( "count" )

A comparision of the before and after state showed, that the garbage collection worked well for all "native" Lua variables.

A C++ object constructed and referenced / dereferenced from Lua side didn't garbage collected (I cheked it with a breakpoint in the C++ destructor)

e.g.

local test = CTest:new()
test = nil

collectgarbage ( "collect" )


Am I missing something or has anybody the same experience or maybe some extra hints in this context?

Best Regards
Michael