mirror of
https://github.com/correl/Transmission-XBMC.git
synced 2024-11-22 03:00:15 +00:00
Correctly terminating the timer
This commit is contained in:
parent
ce23147d3f
commit
7d1d517102
1 changed files with 5 additions and 3 deletions
|
@ -113,7 +113,8 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
|||
list.addItem(item)
|
||||
list.setEnabled(bool(self.torrents))
|
||||
|
||||
# Update again, after an interval
|
||||
# Update again, after an interval, but only if the timer has not been cancelled
|
||||
if self.timer:
|
||||
self.timer = threading.Timer(UPDATE_INTERVAL, self.updateTorrents)
|
||||
self.timer.start()
|
||||
def onClick(self, controlID):
|
||||
|
@ -225,6 +226,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
|||
def close(self):
|
||||
if self.timer:
|
||||
self.timer.cancel()
|
||||
self.timer = None
|
||||
super(TransmissionGUI, self).close()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue