added _cleanup(), a function called if present on a module before being unloaded.
This commit is contained in:
parent
9c5f0d6035
commit
2015b1971c
1 changed files with 2 additions and 0 deletions
|
@ -71,6 +71,8 @@ class ModuleManager(object):
|
|||
# this is such a bad idea
|
||||
module._is_unloaded = True
|
||||
self.unhook_check(self.bot.events)
|
||||
if hasattr(module, "_cleanup"):
|
||||
module._cleanup()
|
||||
del sys.modules[module._import_name]
|
||||
del self.modules[module._name]
|
||||
del module
|
||||
|
|
Loading…
Reference in a new issue