mirror of https://gitlab.com/pamhyr/pamhyr2
WaitingDialog: Try fix deadlock.
parent
363b9c7132
commit
4537a829af
|
|
@ -90,6 +90,7 @@ class WaitingDialog(PamhyrDialog):
|
|||
options=[],
|
||||
parent=parent
|
||||
)
|
||||
self._to_close = False
|
||||
|
||||
self._payload_fn = payload_fn
|
||||
|
||||
|
|
@ -131,7 +132,7 @@ class WaitingDialog(PamhyrDialog):
|
|||
)
|
||||
|
||||
def end_worker(self):
|
||||
self._worker_thread.terminate()
|
||||
self._worker_thread.quit()
|
||||
self._worker_thread.wait()
|
||||
|
||||
def close(self):
|
||||
|
|
@ -141,4 +142,12 @@ class WaitingDialog(PamhyrDialog):
|
|||
except Exception as e:
|
||||
logger_exception(e)
|
||||
|
||||
self._to_close = True
|
||||
|
||||
super().close()
|
||||
|
||||
def closeEvent(self, event):
|
||||
if self._to_close:
|
||||
super().closeEvent(event)
|
||||
else:
|
||||
event.ignore()
|
||||
|
|
|
|||
Loading…
Reference in New Issue