diff options
-rw-r--r-- | module/ThreadManager.py | 8 | ||||
-rwxr-xr-x | pyLoadCore.py | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/module/ThreadManager.py b/module/ThreadManager.py index 9aa3368c0..365efa764 100644 --- a/module/ThreadManager.py +++ b/module/ThreadManager.py @@ -24,6 +24,7 @@ from subprocess import Popen from threading import Event from time import sleep from traceback import print_exc +import pycurl import PluginThread from module.network.Request import getURL @@ -48,6 +49,8 @@ class ThreadManager: self.reconnecting = Event() self.reconnecting.clear() + pycurl.global_init(pycurl.GLOBAL_DEFAULT) + for i in range(0, self.core.config.get("general", "max_downloads")): self.createThread() @@ -193,4 +196,7 @@ class ThreadManager: else: thread = PluginThread.DecrypterThread(self, job) - + + def cleanup(self): + """do global cleanup""" + pycurl.global_cleanup() diff --git a/pyLoadCore.py b/pyLoadCore.py index e0322975e..2f9f7783b 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -477,6 +477,7 @@ class Core(object): finally: self.files.syncSave() + self.threadManager.cleanup() self.shuttedDown = True |