Mercurial > prosody-modules
diff mod_register_apps/mod_register_apps.lua @ 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 | aba0470ed725 |
children | 635907a5d2c8 |
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