-1
嗨,大家好,我有一点麻烦。 我完成了我的程序,它检查bitbucket上是否存在新版本。 除了当我关闭我的应用程序和线程仍在运行时,一切都很好,程序可以在任务管理器中看到。 EVT_CLOSE的 代码如下:wxpython关闭线程的应用程序
def on_close(self, event):
if self._thread is not None and self._thread.isAlive():
self._thread.interrupt.set()
self.Destroy()
event.Skip()
线程在运行像守护进程。
怎么了?
编辑: 我understund和我试图做线程上的join()方法。 但我不工作。
def on_close(self, event):
if self._thread is not None and self._thread.isAlive():
self._thread.join()
self._thread.interrupt.set()
self.Destroy()
event.Skip()
和:
def on_close(self, event):
if self._thread is not None and self._thread.isAlive():
self._thread.join(10)
self._thread.interrupt.set()
self.Destroy()
event.Skip()
我更新了我的答案;) – marcio