Converter/Poll.py: fix suspend
[enigma2.git] / lib / python / Components / Converter / Poll.py
index 060c12e..23ce133 100644 (file)
@@ -3,7 +3,7 @@ from enigma import eTimer
 class Poll(object):
        def __init__(self):
                self.__poll_timer = eTimer()
-               self.__poll_timer.timeout.get().append(self.poll)
+               self.__poll_timer.callback.append(self.poll)
                self.__interval = 1000
                self.__enabled = False
 
@@ -25,7 +25,12 @@ class Poll(object):
                self.changed((self.CHANGED_POLL,))
 
        def doSuspend(self, suspended):
-               self.enabled = not suspended
-               if not suspended:
-                       self.poll()
+               if self.__enabled:
+                       if suspended:
+                               self.__poll_timer.stop()
+                       else:
+                               self.poll()
+                               self.poll_enabled = True
 
+       def destroy(self):
+               self.__poll_timer.callback.remove(self.poll)