mirror of
https://github.com/correl/Transmission-XBMC.git
synced 2024-11-21 19:18:41 +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,9 +113,10 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
|||
list.addItem(item)
|
||||
list.setEnabled(bool(self.torrents))
|
||||
|
||||
# Update again, after an interval
|
||||
self.timer = threading.Timer(UPDATE_INTERVAL, self.updateTorrents)
|
||||
self.timer.start()
|
||||
# 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):
|
||||
list = self.getControl(120)
|
||||
if (controlID == 111):
|
||||
|
@ -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