wireplumber/modules/module-lua-scripting/wplua
Julian Bouzas a824ae910f m-lua-scripting: only hold a strong reference of the Lua state when the script is enabled
Scripts are always deactivated (and not finalized) before core disconnects, so
we need to make sure the scripts don't hold a strong reference when creating
them. They must only hold a strong reference of the Lua state if activated.

In order to implement this properly, the lua_State has been wrapped into a
GObject so that the 'lua-engine' construct-only property is a weak reference of
the Lua state. Then, when the script is activated, a strong reference of the Lua
state is held so the script can work. This strong reference is later dropped
when the script is deactivated (right before the core is disconnected), avoiding
leaked proxy warning messages in the log if a script has a global variable
holding a proxy (Eg the alsa monitor in alsa.lua).
2026-06-01 07:37:02 -04:00
..
boxed.c m-lua-scripting: Handle both Properties and Lua tables in all Lua APIs 2025-11-24 19:42:07 +02:00
closure.c wplua: move under modules/module-lua-scripting 2022-03-24 09:47:59 +02:00
gresource.xml wplua: move under modules/module-lua-scripting 2022-03-24 09:47:59 +02:00
meson.build meson: move the common CFLAGS to project-wide scope 2024-03-09 15:58:01 +02:00
object.c Fix Lua type confusion bug 2025-07-29 17:24:35 -04:00
private.h Fix Lua type confusion bug 2025-07-29 17:24:35 -04:00
sandbox.lua docs: fix various codebase typos Found via codespell -q 3 -S "*.po,./po/*,NEWS.rst" -L bootup,gir,inout 2025-01-28 15:45:54 +01:00
userdata.c Fix Lua type confusion bug 2025-07-29 17:24:35 -04:00
value.c m-lua-scripting: Handle both Properties and Lua tables in all Lua APIs 2025-11-24 19:42:07 +02:00
wplua.c m-lua-scripting: only hold a strong reference of the Lua state when the script is enabled 2026-06-01 07:37:02 -04:00
wplua.h m-lua-scripting: only hold a strong reference of the Lua state when the script is enabled 2026-06-01 07:37:02 -04:00