diff --git a/kivy/modules/__init__.py b/kivy/modules/__init__.py index 9e6d5b9ce..376dd4a09 100644 --- a/kivy/modules/__init__.py +++ b/kivy/modules/__init__.py @@ -147,17 +147,20 @@ class ModuleBase: name, context) Logger.debug(msg) module.start(win, context) + self.mods[name]['activated'] = True def deactivate_module(self, name, win): '''Deactivate a module from a window''' if not name in self.mods: Logger.warning('Modules: Module <%s> not found' % name) return - if not hasattr(self.mods[name], 'module'): + if not 'module' in self.mods[name]: return + module = self.mods[name]['module'] if self.mods[name]['activated']: module.stop(win, self.mods[name]['context']) + self.mods[name]['activated'] = False def register_window(self, win): '''Add window in window list'''