aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2011-04-26 13:05:58 +0200
committerghost <andreas.monzner@multimedia-labs.de>2011-04-26 13:05:58 +0200
commit0594e9b14342c2bca8b574ffabbc58d5dcf80dab (patch)
tree7b3e9f3f1737338af75994c34c0caa8ffda437a0
parent348cf0e4d7fa1e615635984c9325fc0e8fa4e72b (diff)
downloadenigma2-0594e9b14342c2bca8b574ffabbc58d5dcf80dab.tar.gz
enigma2-0594e9b14342c2bca8b574ffabbc58d5dcf80dab.zip
shutdown bdpoll thread on e2 shutdown
this is needed for newer python versions... thanks to ritzmo fixes bug #671
-rw-r--r--lib/python/Plugins/SystemPlugins/Hotplug/plugin.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
index 84cbbcb6..21b214a5 100644
--- a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
@@ -50,12 +50,12 @@ IOC_TYPESHIFT = (IOC_NRSHIFT+IOC_NRBITS)
BLKRRPART = ((0x12<<IOC_TYPESHIFT) | (95<<IOC_NRSHIFT))
def autostart(reason, **kwargs):
+ global bdpoll
if reason == 0:
print "starting hotplug handler"
if fileExists('/dev/.udev'):
global netlink
- global bdpoll
from enigma import eSocketNotifier, eTimer, ePythonMessagePump
import socket
from select import POLLIN, POLLPRI
@@ -295,6 +295,12 @@ def autostart(reason, **kwargs):
factory = Factory()
factory.protocol = Hotplug
reactor.listenUNIX("/tmp/hotplug.socket", factory)
+ else:
+ if bdpoll:
+ bdpoll.running = False
+ bdpoll.timeout() # XXX: I assume the timer is shut down before it executes again, so release the semaphore manually
+ bdpoll.join()
+ bdpoll = None
def Plugins(**kwargs):
return PluginDescriptor(name = "Hotplug", description = "listens to hotplug events", where = PluginDescriptor.WHERE_AUTOSTART, needsRestart = True, fnc = autostart)