From e58d36f8bfee69af0a95a50719f44ff3ae781e48 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 28 Dec 2009 09:15:33 -0200 Subject: [PATCH] clear the thread pool on quit --- .../issue-3b259da1d5ba1894c81778cba79d1e450f8ed2a9.yaml | 8 ++++++-- mitterlib/ui/ui_pygtk.py | 9 ++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/issues/issue-3b259da1d5ba1894c81778cba79d1e450f8ed2a9.yaml b/issues/issue-3b259da1d5ba1894c81778cba79d1e450f8ed2a9.yaml index ed41810..ce1ba77 100644 --- a/issues/issue-3b259da1d5ba1894c81778cba79d1e450f8ed2a9.yaml +++ b/issues/issue-3b259da1d5ba1894c81778cba79d1e450f8ed2a9.yaml @@ -5,8 +5,8 @@ type: :bugfix component: pygtk release: 1.0.0 reporter: Julio Biason -status: :unstarted -disposition: +status: :closed +disposition: :fixed creation_time: 2009-12-16 14:19:30.288852 Z references: [] @@ -16,3 +16,7 @@ log_events: - Julio Biason - created - kill the threads +- - 2009-12-28 11:15:15.790074 Z + - Julio Biason + - closed with disposition fixed + - at least, I think so. diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 9a23838..18791b3 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -32,7 +32,6 @@ import webbrowser from cgi import escape as html_escape from mitterlib.ui.helpers.image_helpers import find_image -from mitterlib import htmlize from mitterlib.constants import gpl_3, version from mitterlib.ui.helpers import timesince @@ -194,6 +193,13 @@ class _ThreadManager(object): self._thread_id += 1 return + def clear(self): + """Clear the thread pool list. This will cause the manager to stop + working after the threads finish.""" + self._thread_pool = [] + self._running = [] + return + # ---------------------------------------------------------------------- # Mitter interface object @@ -824,6 +830,7 @@ class Interface(object): self._options[self.NAMESPACE]['height'] = height # TODO: Kill any threads running. + self._threads.clear() gtk.main_quit() return