Conversation
| collectgarbage("stop") | ||
| local vimage = vips_lib.vips_image_get_gainmap(self.vimage) | ||
| if vimage == ffi.NULL then | ||
| return nil |
There was a problem hiding this comment.
Do you need to restart the gc here?
There was a problem hiding this comment.
Yes, for Lua 5.4, see below.
ca7df97 to
7e8f5c4
Compare
jcupitt
left a comment
There was a problem hiding this comment.
oop, forgot to submit this one
| end | ||
|
|
||
| function Image_method:get_gainmap() | ||
| collectgarbage("stop") |
There was a problem hiding this comment.
I'm not certain you need to stop and restart the GC -- with the API change vips_image_get_gainmap now returns a true reference, so your pointer should be safe.
There was a problem hiding this comment.
It should be, but there are some oddities in Lua 5.4 which cause a crash (illegal machine instruction) when running the uhdr.lua script (still seen in https://github.com/libvips/lua-vips/compare/ca7df971d6a3a34ce9a076e8c3e238812c1452f2..7e8f5c44813ee311e0acf1e3f5c4bd0bf97c175d) via lua5.4 uhdr.lua.
It works fine with lua5.3 and luajit without stopping the GC.
7e8f5c4 to
ca515b0
Compare
Closes #94