summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-03-10 23:58:20 +0100
committermathieui <mathieui@mathieui.net>2013-03-10 23:58:20 +0100
commiteb2e5825bceec1171f0e154cb72f5870576a94f2 (patch)
tree8566d9b802f15a5419324a648c0fc1ba48f08e04
parentf0fb3d5d7afbebc521de7ca971a96741b8bb1a9f (diff)
downloadpoezio-eb2e5825bceec1171f0e154cb72f5870576a94f2.tar.gz
poezio-eb2e5825bceec1171f0e154cb72f5870576a94f2.tar.bz2
poezio-eb2e5825bceec1171f0e154cb72f5870576a94f2.tar.xz
poezio-eb2e5825bceec1171f0e154cb72f5870576a94f2.zip
Disable plugins on exit
-rw-r--r--src/core.py1
-rw-r--r--src/plugin_manager.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 8dd1b739..a37788e7 100644
--- a/src/core.py
+++ b/src/core.py
@@ -2230,6 +2230,7 @@ class Core(object):
msg = arg
else:
msg = None
+ self.plugin_manager.disable_plugins()
self.disconnect(msg)
self.running = False
self.reset_curses()
diff --git a/src/plugin_manager.py b/src/plugin_manager.py
index afd04330..693a90c6 100644
--- a/src/plugin_manager.py
+++ b/src/plugin_manager.py
@@ -67,6 +67,13 @@ class PluginManager(object):
self.roster_elements = {}
self.plugin_api = PluginAPI(core, self)
+ def disable_plugins(self):
+ for plugin in set(self.plugins.keys()):
+ try:
+ self.unload(plugin)
+ except:
+ pass
+
def load(self, name, notify=True):
"""
Load a plugin.