[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: gc problem when using lightuserdata to reference C++ objects
- From: matias.guijarro@...
- Date: Fri, 14 Nov 2008 13:10:01 +0100
Hi,
Quoting "Cheng, Long" <long.x.cheng@gmail.com>:
> Or is there other
> "proper" ways to handle the objects life cycle? Thanks!
>
Use normal userdata instead of lightuserdata ; associate a
metatable with it, and free memory in the __gc metamethod
(which does not exist for lightuserdata).
You can learn more from :
http://www.lua.org/pil/28.1.html
Cheers,
Matias.