aa0b2bb5fc
In some cases rencache was using a FontDesc pointer that was actually freed by Lua giving segfaults errors. In addition, some FontDesc object were not freed in some cases if the rencache_end_frame was not called when performing the "restart" command. The invalid access problem can happen because rencache keep some pointers to FontDesc object but these are Lua userdata that Lua can dispose of. This situation is prone to hard errors and we should avoid to keep pointers to objects managed by Lua. To this purpose we use luaL_ref/unref to bind the FontDesc into the Lua's registry while rencache need them. We still keeps pointer to FontDesc object but using luaL_ref we are assured they will not be disposed by Lua. Since we are using luaL_ref/unref to inform the GC about when the objects are in use we can now finalize the objects directly when Lua collects them. Previously the GC metamethods was issuing a FREE command to rencache and the font was actually freed only from the rencache_end_frame function. |
||
---|---|---|
.. | ||
api | ||
bundle_open.m | ||
fontdesc.c | ||
fontdesc.h | ||
main.c | ||
meson.build | ||
rencache.c | ||
rencache.h | ||
renderer.c | ||
renderer.h | ||
renwindow.c | ||
renwindow.h |