File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1414# ---- Standard imports
1515from collections import OrderedDict
1616import uuid
17+ from time import sleep
1718
1819# ---- Third party imports
1920from qtpy .QtCore import QObject , QThread , Signal
@@ -203,11 +204,13 @@ def _run_pending_tasks(self):
203204
204205 # Even though the worker has executed all its tasks,
205206 # we may still need to wait a little for it to stop properly.
206- try :
207- qtwait (lambda : not self ._thread .isRunning (), timeout = 10 )
208- except TimeoutError :
209- print ("Error: unable to stop {}'s working thread." .format (
210- self .__class__ .__name__ ))
207+ i = 0
208+ while self ._thread .isRunning ():
209+ sleep (0.1 )
210+ i += 1
211+ if i > 100 :
212+ print ("Error: unable to stop {}'s working thread." .format (
213+ self .__class__ .__name__ ))
211214
212215 self ._running_tasks = self ._pending_tasks .copy ()
213216 self ._pending_tasks = []
You can’t perform that action at this time.
0 commit comments