Only try to stop LoopingCalls if they are running

This commit is contained in:
Andrew Resch 2009-11-05 04:35:17 +00:00
parent 447da3b1b4
commit fb4495fc33

View File

@ -210,8 +210,11 @@ class TorrentManager(component.Component):
def stop(self):
# Stop timers
self.save_state_timer.stop()
self.save_resume_data_timer.stop()
if self.save_state_timer.running:
self.save_state_timer.stop()
if self.save_resume_data_timer.running:
self.save_resume_data_timer.stop()
# Save state on shutdown
self.save_state()