Stop some LoopingCalls when stopping components

This commit is contained in:
Andrew Resch 2009-07-04 22:53:10 +00:00
parent 061cd96096
commit 7815f22a73
2 changed files with 8 additions and 0 deletions

View File

@ -236,6 +236,10 @@ class PreferencesManager(component.Component):
self.config.register_change_callback(self._on_config_value_change) self.config.register_change_callback(self._on_config_value_change)
def stop(self):
if self.new_release_timer:
self.new_release_timer.stop()
# Config set functions # Config set functions
def _on_config_value_change(self, key, value): def _on_config_value_change(self, key, value):
component.get("EventManager").emit(ConfigValueChangedEvent(key, value)) component.get("EventManager").emit(ConfigValueChangedEvent(key, value))

View File

@ -201,6 +201,10 @@ class TorrentManager(component.Component):
self.save_resume_data_timer.start(190) self.save_resume_data_timer.start(190)
def stop(self): def stop(self):
# Stop timers
self.save_state_timer.stop()
self.save_resume_data_timer.stop()
# Save state on shutdown # Save state on shutdown
self.save_state() self.save_state()