From 70f0335777fda2af506db6937e2780c7939a1583 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 28 Dec 2009 07:20:00 -0200 Subject: [PATCH] Missing thread removal on exception --- mitterlib/ui/ui_pygtk.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 8ab9b09..9a23838 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -118,7 +118,7 @@ class _WorkerThread(threading.Thread, _IdleObject): result = self._function(*args, **kwargs) except Exception, exc: # Catch ALL exceptions # TODO: Check if this catch all warnins too! - _log.debug('Exception %s', str(exc)) + _log.debug('Exception inside thread: %s', str(exc)) self.emit("exception", exc) return @@ -177,6 +177,7 @@ class _ThreadManager(object): thread.connect('completed', complete_cb) thread.connect('completed', self._remove_thread) thread.connect('exception', exception_cb) + thread.connect('exception', self._remove_thread) thread.setName(thread_id) if len(self._running) < self._max_threads: