lua-users home
lua-l archive

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

On Thu, Jan 11, 2001 at 02:50:14PM -0200, Waldemar Celes wrote:
> no, it won't be collected. objects created with "new" should be
> explicitly deleted with "delete".  or you may call the function
> "takeownership" to tell tolua to collect it when it leaves the
> scope.

I wrote some meta-code that makes this somewhat easier. Basically, if
you define a class A, it lets you do the following:

uncollected_instance = A:new(blah ...)
collected_instance = A(blah ...)

The first syntax does not take ownership, while the second one
does. Siome and I find this pretty convenient in our project. If
anyone is interested, e-mail me, and I will make it available.

I also have a whole bunch of tips and tricks for generating good C++
bindings with tolua. Trouble is only, they all pertain to tolua 3.2,
and I'm not sure how many of them are still valid for tolua 4.0. But
again, if anyone is interested, I will be happy to share them.

- Christian