aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/modulemanager.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 7ee262c4..032cab84 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -200,6 +200,15 @@ function unload(host, name, ...)
end
end
hooks:remove(host, name);
+ if mod.module.items then -- remove items
+ for key,t in pairs(mod.module.items) do
+ for i = #t,1,-1 do
+ local value = t[i];
+ t[i] = nil;
+ hosts[host].events.fire_event("item-removed/"..key, {source = self, item = value});
+ end
+ end
+ end
modulemap[host][name] = nil;
hosts[host].events.fire_event("module-unloaded", { module = name, host = host });
return true;