Fixed memory leak: widget factories need to be deleted

in opentxClose()
This commit is contained in:
Raphael Coeffic
2021-06-12 07:38:31 +02:00
parent c37bc91475
commit 78915daf95
4 changed files with 17 additions and 0 deletions
+10
View File
@@ -512,3 +512,13 @@ void luaInitThemesAndWidgets()
luaDoGc(lsWidgets, true);
}
}
void luaUnregisterWidgets()
{
std::list<const WidgetFactory *> regWidgets(getRegisteredWidgets());
for (auto w : regWidgets) {
if (dynamic_cast<const LuaWidgetFactory*>(w)) {
delete w;
}
}
}