[vlc-devel] [PATCH] lua: fixed object release function
quentin.chateau at deepskycorp.com
Sun Feb 23 16:33:36 CET 2020
To be fair I started to do it this way, and ran into the issue that luaL_checkudata is strict on the type it is checking (no "polymorphism"), and you'd need to add a wrapper around that to have the functions in variables.c work. Note that the wrapper is not easy to implement properly, at least with my small understanding of Lua.
I finally decided that a simpler and less intrusive patch was more fitting. As the Lua code almost did not change for 7+ years, I preferred this simple fix to a very bad problem introduced in a relatively recent patchset. Reworking the Lua types could be done as well but I think it is a different matter.
To give more input about the bug: I use the HTTP interface, and calling /requests/status.json in a loop would cause a segmentation fault systematically.
On Feb 23, 2020, 15:35, at 15:35, "Rémi Denis-Courmont" <remi at remlab.net> wrote:
>Le perjantaina 21. helmikuuta 2020, 16.04.31 EET
>quentin.chateau at deepskycorp.com a écrit :
>> From: Quentin Chateau <quentin.chateau at deepskycorp.com>
>> As a single metatable for vlc_object exists
>> all lua objects in objects.c would be freed
>> with the same release function
>Yes but isn't it far simpler to use a different meta table for each
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vlc-devel