From 05c4ff16be9fd579cafba4e90c81d80c5ff0c776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 21 Sep 2008 19:03:44 +0200 Subject: [PATCH] Fix thread exception when stopping server --- trytond/netsvc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trytond/netsvc.py b/trytond/netsvc.py index 6db52110fc..9d9db40f2d 100644 --- a/trytond/netsvc.py +++ b/trytond/netsvc.py @@ -334,13 +334,14 @@ class TinySocketServerThread(threading.Thread): self.secure) self.threads.append(c_thread) c_thread.start() - finally: + except: self.socket.close() return False def stop(self): self.running = False - for thread in self.threads: + while len(self.threads): + thread = self.threads[0] thread.stop() try: if hasattr(socket, 'SHUT_RDWR'):