diff options
| author | 2018-10-04 14:45:32 +0100 | |
|---|---|---|
| committer | 2018-10-04 14:45:32 +0100 | |
| commit | c0fbe963a537849d57f462c4ccd5a3c3e95f8a07 (patch) | |
| tree | 504db48c3fc9fd404ed394401c8601c0883b5e4e | |
| parent | IRCChannel.send_part should have a `self` param! (diff) | |
| signature | ||
Try calling module.unload() (if it exists) when unloading a module
| -rw-r--r-- | src/ModuleManager.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ModuleManager.py b/src/ModuleManager.py index 5d997f54..0a9d0d67 100644 --- a/src/ModuleManager.py +++ b/src/ModuleManager.py @@ -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 |
