lua-users home
lua-l archive

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


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