Changeset

4187:e2db07017332

mod_register_apps: Fix removal of apps from array on unload
author Kim Alvefur <zash@zash.se>
date Sat, 10 Oct 2020 16:54:06 +0200
parents 4186:aba0470ed725
children 4188:4611999fd8d3
files mod_register_apps/mod_register_apps.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_register_apps/mod_register_apps.lua	Sat Oct 10 16:52:36 2020 +0200
+++ b/mod_register_apps/mod_register_apps.lua	Sat Oct 10 16:54:06 2020 +0200
@@ -133,6 +133,11 @@
 
 local function remove_app(app_info)
 	local app_id = app_info.id or app_info.name:gsub("%W+", "-"):lower();
+	for i = #site_apps, 1, -1 do
+		if site_apps[i].id == app_id then
+			table.remove(site_apps, i);
+		end
+	end
 	site_apps[app_id] = nil;
 end