Browse Source

Missing thread removal on exception

master
Julio Biason 15 years ago
parent
commit
70f0335777
  1. 3
      mitterlib/ui/ui_pygtk.py

3
mitterlib/ui/ui_pygtk.py

@ -118,7 +118,7 @@ class _WorkerThread(threading.Thread, _IdleObject):
result = self._function(*args, **kwargs) result = self._function(*args, **kwargs)
except Exception, exc: # Catch ALL exceptions except Exception, exc: # Catch ALL exceptions
# TODO: Check if this catch all warnins too! # 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) self.emit("exception", exc)
return return
@ -177,6 +177,7 @@ class _ThreadManager(object):
thread.connect('completed', complete_cb) thread.connect('completed', complete_cb)
thread.connect('completed', self._remove_thread) thread.connect('completed', self._remove_thread)
thread.connect('exception', exception_cb) thread.connect('exception', exception_cb)
thread.connect('exception', self._remove_thread)
thread.setName(thread_id) thread.setName(thread_id)
if len(self._running) < self._max_threads: if len(self._running) < self._max_threads:

Loading…
Cancel
Save