WaitingDialog: Try fix deadlock.

disable_edition_parent_scenario
Pierre-Antoine 2026-05-21 16:26:25 +02:00
parent 363b9c7132
commit 4537a829af
1 changed files with 10 additions and 1 deletions

View File

@ -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()