diff options
author | mkaay <mkaay@mkaay.de> | 2009-12-24 01:41:13 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2009-12-24 01:41:13 +0100 |
commit | 5c7e9f0f1325523347a52869cebbf03463550bca (patch) | |
tree | 48f33c94330fc41e5af0209d03177c4179c78bc3 /module | |
parent | downloads are now aborted correctly, gui: remove downloads, new icons (diff) | |
download | pyload-5c7e9f0f1325523347a52869cebbf03463550bca.tar.xz |
clean shutdown
Diffstat (limited to 'module')
-rw-r--r-- | module/thread_list.py | 4 | ||||
-rw-r--r-- | module/web/ServerThread.py | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/module/thread_list.py b/module/thread_list.py index 966157b91..fc4160a6d 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -216,6 +216,10 @@ class Thread_List(object): def scripts_reconnected(self, ip): map(lambda script: subprocess.Popen([script, ip], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) + def stopAllDownloads(self): + for pyfile in self.py_downloading: + pyfile.plugin.req.abort = True + class SpeedManager(Thread): def __init__(self, parent): Thread.__init__(self) diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 0d6044562..069cabafe 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -36,7 +36,10 @@ class WebServer(threading.Thread): def quit(self): if os.name == 'posix': - os.kill(self.pid, SIGINT) + try: + os.kill(self.pid, SIGINT) + except: + pass else: self.p.kill() |