add destroy() for Components to fix bug #52
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 9 Apr 2006 21:56:50 +0000 (21:56 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 9 Apr 2006 21:56:50 +0000 (21:56 +0000)
lib/python/Components/ActionMap.py
lib/python/Components/GUIComponent.py
lib/python/Components/PerServiceDisplay.py
lib/python/Screens/Screen.py

index a6f5eb9..ee3d31d 100644 (file)
@@ -50,6 +50,9 @@ class ActionMap:
                        print "unknown action %s/%s! typo in keymap?" % (context, action)
                        return 0
 
                        print "unknown action %s/%s! typo in keymap?" % (context, action)
                        return 0
 
+       def destroy(self):
+               pass
+
 class NumberActionMap(ActionMap):
        def action(self, contexts, action):
                numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
 class NumberActionMap(ActionMap):
        def action(self, contexts, action):
                numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
index 493df68..8f6362f 100644 (file)
@@ -24,6 +24,9 @@ class GUIComponent:
        def onHide(self):
                pass
        
        def onHide(self):
                pass
        
+       def destroy(self):
+               pass
+       
        # this works only with normal widgets - if you don't have self.instance, override this.
        def applySkin(self, desktop):
                if self.state == self.HIDDEN:
        # this works only with normal widgets - if you don't have self.instance, override this.
        def applySkin(self, desktop):
                if self.state == self.HIDDEN:
index 55ef3d1..821f6d1 100644 (file)
@@ -17,6 +17,9 @@ class PerServiceBase(GUIComponent):
                # start with stopped state, so simulate that
                self.event(iPlayableService.evEnd)
 
                # start with stopped state, so simulate that
                self.event(iPlayableService.evEnd)
 
+       def destroy(self):
+               self.navcore.event.remove(self.event)
+
        def event(self, ev):
                # loop up if we need to handle this event
                if self.eventmap.has_key(ev):
        def event(self, ev):
                # loop up if we need to handle this event
                if self.eventmap.has_key(ev):
index 8398dad..d4b3d72 100644 (file)
@@ -67,6 +67,7 @@ class Screen(dict, HTMLSkin, GUISkin):
                
                del self.session
                for (name, val) in self.items():
                
                del self.session
                for (name, val) in self.items():
+                       val.destroy()
                        del self[name]
                
                # really delete all elements now
                        del self[name]
                
                # really delete all elements now