[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C upvalue cleanup not being called
- From: David Crayford <dcrayford@...>
- Date: Thu, 13 Mar 2014 20:43:27 +0800
It's my mistake for sure. I copied the code from lua-cjson and the
finalizer gets called in that code in 5.1
I know it's something stupid but I don't know the C API well enough to
fix it. The full code is here http://hastebin.com/likikexinu.coffee.
On 12/03/2014 8:27 PM, Ignacio Burgueño wrote:
Unless I'm mistaken, that won't work with Lua 5.1 since the __gc
metamethod for tables was introduced in 5.2.
In this case, it does nothing. You'll need a userdata to achieve the
You should take a look at Thijs Schreijer's "Lua Library Template"
For instance, this example does what you want: