enigma2: fixed random crashes (caused by missing del call)
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-3.999git20130831 / 0001-ServiceScan.py-fixed-crash-on-finished-service-scan.patch
1 From 805a2ca347e54668117b7270ab1ec3f6fad64cc9 Mon Sep 17 00:00:00 2001
2 From: ghost <andreas.monzner@dream-property.net>
3 Date: Sat, 31 Aug 2013 16:32:02 +0200
4 Subject: [PATCH] ServiceScan.py: fixed crash on finished service scan
5
6 ---
7  usr/lib/enigma2/python/Components/ServiceScan.py | 14 ++++++++------
8  1 file changed, 8 insertions(+), 6 deletions(-)
9
10 diff --git a/usr/lib/enigma2/python/Components/ServiceScan.py b/usr/lib/enigma2/python/Components/ServiceScan.py
11 index dbc7b4b..ae5ee98 100644
12 --- a/usr/lib/enigma2/python/Components/ServiceScan.py
13 +++ b/usr/lib/enigma2/python/Components/ServiceScan.py
14 @@ -119,6 +119,7 @@ class ServiceScan:
15                 self.network = network
16                 self.run = 0
17                 self.lcd_summary = lcd_summary
18 +               self.scan = None
19  
20         def doRun(self):
21                 self.scan = eComponentScan()
22 @@ -151,12 +152,13 @@ class ServiceScan:
23                 self.scanStatusChanged()
24         
25         def execEnd(self):
26 -               self.scan.statusChanged.get().remove(self.scanStatusChanged)
27 -               self.scan.newService.get().remove(self.newService)
28 -               if not self.isDone():
29 -                       print "*** warning *** scan was not finished!"
30 -               
31 -               del self.scan
32 +               if self.scan:
33 +                       self.scan.statusChanged.get().remove(self.scanStatusChanged)
34 +                       self.scan.newService.get().remove(self.newService)
35 +                       if not self.isDone():
36 +                               print "*** warning *** scan was not finished!"
37 +
38 +                       self.scan = None
39  
40         def isDone(self):
41                 return self.state == self.Done or self.state == self.Error
42 -- 
43 1.8.4.rc3
44