Make a copy of the thread names so that if one disappears while we're waiting, we don't cause an error

This commit is contained in:
Raoul Snyman 2019-09-10 13:34:03 -07:00
parent 265dc0ded9
commit c7965337ba
1 changed files with 4 additions and 1 deletions

View File

@ -552,7 +552,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, LogMixin, RegistryPropert
wait_dialog.setAutoClose(False)
wait_dialog.setCancelButton(None)
wait_dialog.show()
for thread_name in self.application.worker_threads.keys():
thread_names = self.application.worker_threads.keys()
for thread_name in thread_names:
if thread_name not in self.application.worker_threads.keys():
continue
self.log_debug('Waiting for thread %s' % thread_name)
self.application.processEvents()
thread = self.application.worker_threads[thread_name]['thread']