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 9cd56187..ecb1bc6c 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -197,6 +197,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;
return true;
end