Try calling module.unload() (if it exists) when unloading a module

This commit is contained in:
jesopo 2018-10-04 14:45:32 +01:00
parent 72602e13f9
commit c0fbe963a5

View file

@ -134,6 +134,11 @@ class ModuleManager(object):
if not name in self.modules:
raise ModuleNotFoundException()
module = self.modules[name]
if hasattr(module, "unload"):
try:
module.unload()
except:
pass
del self.modules[name]
context = module._context