aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-02-14 20:40:05 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-02-14 20:40:05 +0000
commit8c2a83d6b2a60b2bd408ccdc6d5afd6da506912f (patch)
treec382ddc39fdc759befd9e281bcc011e1dd579e9d /lib/python/Components
parent6f73e6abddf4170357c490966d0e1c622eb376f5 (diff)
downloadenigma2-8c2a83d6b2a60b2bd408ccdc6d5afd6da506912f.tar.gz
enigma2-8c2a83d6b2a60b2bd408ccdc6d5afd6da506912f.zip
unlink some cyclic dependencys to get garbage collection working
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/Button.py3
-rw-r--r--lib/python/Components/ConfigList.py3
-rw-r--r--lib/python/Components/Converter/ConditionalShowHide.py2
-rw-r--r--lib/python/Components/Converter/Poll.py2
-rw-r--r--lib/python/Components/EpgList.py6
-rw-r--r--lib/python/Components/HelpMenuList.py5
-rw-r--r--lib/python/Components/Ipkg.py14
-rw-r--r--lib/python/Components/MenuList.py1
-rw-r--r--lib/python/Components/MovieList.py4
-rw-r--r--lib/python/Components/Renderer/Listbox.py4
-rw-r--r--lib/python/Components/ServiceList.py4
-rw-r--r--lib/python/Components/Sources/Boolean.py2
-rw-r--r--lib/python/Components/Sources/Clock.py2
-rw-r--r--lib/python/Components/Sources/FrontendStatus.py2
14 files changed, 40 insertions, 14 deletions
diff --git a/lib/python/Components/Button.py b/lib/python/Components/Button.py
index 25346b42..2a60a98f 100644
--- a/lib/python/Components/Button.py
+++ b/lib/python/Components/Button.py
@@ -31,3 +31,6 @@ class Button(VariableText, HTMLComponent, GUIComponent):
def postWidgetCreate(self, instance):
instance.setText(self.text)
instance.selected.get().append(self.push)
+
+ def preWidgetRemove(self, instance):
+ instance.selected.get().remove(self.push)
diff --git a/lib/python/Components/ConfigList.py b/lib/python/Components/ConfigList.py
index d1b295ba..9a68d428 100644
--- a/lib/python/Components/ConfigList.py
+++ b/lib/python/Components/ConfigList.py
@@ -24,7 +24,7 @@ class ConfigList(HTMLComponent, GUIComponent, object):
def execEnd(self):
rcinput = eRCInput.getInstance()
rcinput.setKeyboardMode(rcinput.kmNone)
- self.timer.timeout.get().remove(self.timeout)
+ self.timer.callback.remove(self.timeout)
def toggle(self):
selection = self.getCurrent()
@@ -77,6 +77,7 @@ class ConfigList(HTMLComponent, GUIComponent, object):
if self.current:
self.current[1].onDeselect(self.session)
instance.selectionChanged.get().remove(self.selectionChanged)
+ instance.setContent(None)
def setList(self, l):
self.timer.stop()
diff --git a/lib/python/Components/Converter/ConditionalShowHide.py b/lib/python/Components/Converter/ConditionalShowHide.py
index f5ec7039..de3df8fa 100644
--- a/lib/python/Components/Converter/ConditionalShowHide.py
+++ b/lib/python/Components/Converter/ConditionalShowHide.py
@@ -61,4 +61,4 @@ class ConditionalShowHide(Converter, object):
def destroy(self):
if self.timer:
- self.timer.timeout.get().remove(self.blinkFunc)
+ self.timer.callback.remove(self.blinkFunc)
diff --git a/lib/python/Components/Converter/Poll.py b/lib/python/Components/Converter/Poll.py
index 33b9f305..6db93ef5 100644
--- a/lib/python/Components/Converter/Poll.py
+++ b/lib/python/Components/Converter/Poll.py
@@ -30,4 +30,4 @@ class Poll(object):
self.poll()
def destroy(self):
- self.__poll_timer.timeout.get().remove(self.poll)
+ self.__poll_timer.callback.remove(self.poll)
diff --git a/lib/python/Components/EpgList.py b/lib/python/Components/EpgList.py
index 97ed0a03..e0d5227c 100644
--- a/lib/python/Components/EpgList.py
+++ b/lib/python/Components/EpgList.py
@@ -99,12 +99,16 @@ class EPGList(HTMLComponent, GUIComponent):
pass
GUI_WIDGET = eListbox
-
+
def postWidgetCreate(self, instance):
instance.setWrapAround(True)
instance.selectionChanged.get().append(self.selectionChanged)
instance.setContent(self.l)
+ def preWidgetRemove(self, instance):
+ instance.selectionChanged.get().remove(self.selectionChanged)
+ instance.setContent(None)
+
def recalcEntrySize(self):
esize = self.l.getItemSize()
self.l.setFont(0, gFont("Regular", 22))
diff --git a/lib/python/Components/HelpMenuList.py b/lib/python/Components/HelpMenuList.py
index 07bbdd2a..3d36e958 100644
--- a/lib/python/Components/HelpMenuList.py
+++ b/lib/python/Components/HelpMenuList.py
@@ -63,9 +63,12 @@ class HelpMenuList(GUIComponent):
def postWidgetCreate(self, instance):
instance.setContent(self.l)
-
instance.selectionChanged.get().append(self.selectionChanged)
+ def preWidgetRemove(self, instance):
+ instance.setContent(None)
+ instance.selectionChanged.get().remove(self.selectionChanged)
+
def selectionChanged(self):
for x in self.onSelChanged:
x()
diff --git a/lib/python/Components/Ipkg.py b/lib/python/Components/Ipkg.py
index eac26428..361b136a 100644
--- a/lib/python/Components/Ipkg.py
+++ b/lib/python/Components/Ipkg.py
@@ -22,10 +22,7 @@ class IpkgComponent:
self.ipkg = ipkg
self.cmd = eConsoleAppContainer()
- self.cmd.appClosed.get().append(self.cmdFinished)
- self.cmd.dataAvail.get().append(self.cmdData)
self.cache = None
-
self.callbackList = []
self.setCurrentCommand()
@@ -34,8 +31,11 @@ class IpkgComponent:
def runCmd(self, cmd):
print "executing", self.ipkg, cmd
- self.cmd.execute(self.ipkg + " " + cmd)
-
+ self.cmd.appClosed.get().append(self.cmdFinished)
+ self.cmd.dataAvail.get().append(self.cmdData)
+ if self.cmd.execute(self.ipkg + " " + cmd):
+ self.cmdFinished(-1)
+
def startCmd(self, cmd, args = None):
if cmd == self.CMD_UPDATE:
self.runCmd("update")
@@ -56,7 +56,9 @@ class IpkgComponent:
def cmdFinished(self, retval):
self.callCallbacks(self.EVENT_DONE)
-
+ self.cmd.appClosed.get().remove(self.cmdFinished)
+ self.cmd.dataAvail.get().remove(self.cmdData)
+
def cmdData(self, data):
print "data:", data
if self.cache is None:
diff --git a/lib/python/Components/MenuList.py b/lib/python/Components/MenuList.py
index 876300bd..dbdf00a4 100644
--- a/lib/python/Components/MenuList.py
+++ b/lib/python/Components/MenuList.py
@@ -25,6 +25,7 @@ class MenuList(HTMLComponent, GUIComponent):
def preWidgetRemove(self, instance):
instance.setContent(None)
+ instance.selectionChanged.get().remove(self.selectionChanged)
def selectionChanged(self):
for f in self.onSelectionChanged:
diff --git a/lib/python/Components/MovieList.py b/lib/python/Components/MovieList.py
index 6a264098..07dd1152 100644
--- a/lib/python/Components/MovieList.py
+++ b/lib/python/Components/MovieList.py
@@ -153,6 +153,10 @@ class MovieList(GUIComponent):
instance.setContent(self.l)
instance.selectionChanged.get().append(self.selectionChanged)
+ def preWidgetRemove(self, instance):
+ instance.setContent(None)
+ instance.selectionChanged.get().remove(self.selectionChanged)
+
def reload(self, root = None, filter_tags = None):
if root is not None:
self.load(root, filter_tags)
diff --git a/lib/python/Components/Renderer/Listbox.py b/lib/python/Components/Renderer/Listbox.py
index 7c79acb7..8e510b4c 100644
--- a/lib/python/Components/Renderer/Listbox.py
+++ b/lib/python/Components/Renderer/Listbox.py
@@ -39,6 +39,10 @@ class Listbox(Renderer, object):
self.wrap_around = self.wrap_around # trigger
self.selection_enabled = self.selection_enabled # trigger
+ def preWidgetRemove(self, instance):
+ instance.setContent(None)
+ instance.selectionChanged.get().remove(self.selectionChanged)
+
def setWrapAround(self, wrap_around):
self.__wrap_around = wrap_around
if self.instance is not None:
diff --git a/lib/python/Components/ServiceList.py b/lib/python/Components/ServiceList.py
index e39b1d02..2ed32647 100644
--- a/lib/python/Components/ServiceList.py
+++ b/lib/python/Components/ServiceList.py
@@ -131,6 +131,10 @@ class ServiceList(HTMLComponent, GUIComponent):
instance.selectionChanged.get().append(self.selectionChanged)
self.setMode(self.mode)
+ def preWidgetRemove(self, instance):
+ instance.setContent(None)
+ instance.selectionChanged.get().remove(self.selectionChanged)
+
def getRoot(self):
return self.root
diff --git a/lib/python/Components/Sources/Boolean.py b/lib/python/Components/Sources/Boolean.py
index 97b92bc6..f2526a45 100644
--- a/lib/python/Components/Sources/Boolean.py
+++ b/lib/python/Components/Sources/Boolean.py
@@ -35,4 +35,4 @@ class Boolean(Source, object):
def destroy(self):
if self.poll_timer:
- self.poll_timer.timeout.get().remove(self.poll)
+ self.poll_timer.callback.remove(self.poll)
diff --git a/lib/python/Components/Sources/Clock.py b/lib/python/Components/Sources/Clock.py
index 60fa7ac2..5130b21d 100644
--- a/lib/python/Components/Sources/Clock.py
+++ b/lib/python/Components/Sources/Clock.py
@@ -28,4 +28,4 @@ class Clock(Source):
self.poll()
def destroy(self):
- self.clock_timer.timeout.get().remove(self.poll)
+ self.clock_timer.callback.remove(self.poll)
diff --git a/lib/python/Components/Sources/FrontendStatus.py b/lib/python/Components/Sources/FrontendStatus.py
index 141bd8a4..8e29030a 100644
--- a/lib/python/Components/Sources/FrontendStatus.py
+++ b/lib/python/Components/Sources/FrontendStatus.py
@@ -48,5 +48,5 @@ class FrontendStatus(Source):
self.poll_timer.start(self.update_interval)
def destroy(self):
- self.poll_timer.timeout.get().remove(self.updateFrontendStatus)
+ self.poll_timer.callback.remove(self.updateFrontendStatus)