Hotplug: also close thread on language change
authorMoritz Venn <moritz.venn@freaque.net>
Sun, 19 Jun 2011 16:44:49 +0000 (18:44 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Wed, 17 Aug 2011 11:59:45 +0000 (13:59 +0200)
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 <moritz.venn@freaque.net>
Signed-off-by: ghost <andreas.monzner@multimedia-labs.de>
lib/python/Plugins/SystemPlugins/Hotplug/plugin.py

index 21b214a54589d9e3cff31f899d7cd2933ca41c6f..e26a93c60bf44f1bff63a3310c4503a968263eae 100644 (file)
@@ -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: