fix frequently segfault on clean shutdown
[enigma2.git] / lib / python / Components / Sources / Boolean.py
index bd5222afa33008ccd305d213410de865d6c884c8..df7f81b2a68e50bb1b510a02d795d477db0c82fc 100644 (file)
@@ -1,4 +1,5 @@
 from Source import Source
+from Components.Element import cached
 from enigma import eTimer
 
 # a small warning:
@@ -11,11 +12,14 @@ from enigma import eTimer
 class Boolean(Source, object):
        def __init__(self, fixed = False, function = None, poll = 0):
                Source.__init__(self)
+               self.function = function
+               self.fixed = fixed
                if poll > 0:
                        self.poll_timer = eTimer()
                        self.poll_timer.timeout.get().append(self.poll)
                        self.poll_timer.start(poll)
 
+       @cached
        def getBoolean(self):
                if self.function is not None:
                        return self.function()