Stop some LoopingCalls when stopping components
This commit is contained in:
parent
061cd96096
commit
7815f22a73
|
@ -236,6 +236,10 @@ class PreferencesManager(component.Component):
|
|||
|
||||
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
|
||||
def _on_config_value_change(self, key, value):
|
||||
component.get("EventManager").emit(ConfigValueChangedEvent(key, value))
|
||||
|
|
|
@ -201,6 +201,10 @@ class TorrentManager(component.Component):
|
|||
self.save_resume_data_timer.start(190)
|
||||
|
||||
def stop(self):
|
||||
# Stop timers
|
||||
self.save_state_timer.stop()
|
||||
self.save_resume_data_timer.stop()
|
||||
|
||||
# Save state on shutdown
|
||||
self.save_state()
|
||||
|
||||
|
|
Loading…
Reference in New Issue