From 28049a70f8d591d4b6f61ce30c8066e2c00fc6aa Mon Sep 17 00:00:00 2001 From: Moritz Venn Date: Sun, 19 Jun 2011 18:44:49 +0200 Subject: [PATCH] Hotplug: also close thread on language change Previously after a language thread the bdpoll variable was overwritten leaving the old thread run forever and only closing the new one on shutdown (a language changes does NOT call the plugin close handler but the start handler is called again). so before creating a new bdpoll instance check if an old one exists and unset the running flag. Signed-off-by: Moritz Venn Signed-off-by: ghost --- lib/python/Plugins/SystemPlugins/Hotplug/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py index 21b214a5..e26a93c6 100644 --- a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py @@ -256,6 +256,8 @@ def autostart(reason, **kwargs): self.__lock.release() netlink = Netlink() + if bdpoll is not None: + bdpoll.running = False bdpoll = BDPoll() for blockdev, removable, is_cdrom, medium_found in harddiskmanager.devices_scanned_on_init: if removable or is_cdrom: -- 2.30.2