mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-29 19:10:42 +01:00
WaitingDialog: Try fix deadlock.
This commit is contained in:
1 parent
363b9c7132
commit
4537a829af
1 file changed
+10
-1
@@ -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()
|
||||
Reference in new issue
Block a user