From fc6636cf57562a8838a71a09e99194c601558d69 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 25 Mar 2013 18:41:38 +0400 Subject: [PATCH] Clear Powerline.configs when loading main configuration It should eventually clear out stale watches. --- powerline/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/powerline/__init__.py b/powerline/__init__.py index 04513b8b..fccebc2f 100644 --- a/powerline/__init__.py +++ b/powerline/__init__.py @@ -292,6 +292,13 @@ class Powerline(object): :return: dictionary with :ref:`top-level configuration `. ''' + with self.configs_lock: + self.configs.clear() + # Watches for unused files will be cleared automatically after some + # time, no need to do this here, especially considering that + # a) most of them are used and thus will be recreated in other + # load_* calls; + # b) it is hard to tell which ones stopped being useful. return self._load_config('config', 'main_config') def load_colorscheme_config(self, name):