fix(color): widget Lua 'update' function may give unexpected error (#7119)

This commit is contained in:
philmoz
2026-02-22 09:49:58 +10:00
committed by GitHub
parent 044c2a08d8
commit 653a2013ea
10 changed files with 102 additions and 57 deletions
+8 -1
View File
@@ -49,6 +49,13 @@ LuaWidgetFactory::LuaWidgetFactory(const char* name, WidgetOption* widgetOptions
LuaWidgetFactory::~LuaWidgetFactory() {
unregisterWidget(this);
luaL_unref(lsWidgets, LUA_REGISTRYINDEX, optionDefinitionsReference);
luaL_unref(lsWidgets, LUA_REGISTRYINDEX, createFunction);
luaL_unref(lsWidgets, LUA_REGISTRYINDEX, updateFunction);
luaL_unref(lsWidgets, LUA_REGISTRYINDEX, refreshFunction);
luaL_unref(lsWidgets, LUA_REGISTRYINDEX, backgroundFunction);
luaL_unref(lsWidgets, LUA_REGISTRYINDEX, translateFunction);
if (name) delete name;
if (displayName) delete displayName;
@@ -108,7 +115,7 @@ void LuaWidgetFactory::translateOptions(WidgetOption * options)
if (lsWidgets == 0) return;
// No translations provided
if (!translateFunction) return;
if (translateFunction == LUA_REFNIL) return;
#if defined(ALL_LANGS)
char lang[3];