Skip to content

Commit fb6d726

Browse files
committed
Fixes #2120 (ammended)
1 parent 84fbf14 commit fb6d726

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/vorta/utils.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ def __init__(self, decorator_instance, wrapped_instance):
5858
self.wrapped_instance = wrapped_instance
5959

6060
def __call__(self, *args, **kwargs):
61-
global runner_thread
62-
runner_thread = AsyncRunner.Runner(self.decorator_instance, self.wrapped_instance, *args, **kwargs)
63-
runner_thread.start()
61+
self.runner = AsyncRunner.Runner(self.decorator_instance, self.wrapped_instance, *args, **kwargs)
62+
self.runner.finished.connect(self.runner_finished)
63+
self.runner.start()
64+
65+
def runner_finished(self):
66+
self.runner.wait(100)
67+
self.runner = None
6468

6569
class Runner(QtCore.QThread):
6670
def __init__(self, decorator_instance, wrapped_instance, *args, **kwargs):
@@ -72,8 +76,11 @@ def __init__(self, decorator_instance, wrapped_instance, *args, **kwargs):
7276

7377
def run(self):
7478
self.decorator_instance(self.wrapped_instance, *self.args, **self.kwargs)
79+
<<<<<<< HEAD
7580
self.terminate()
7681
self.wait()
82+
=======
83+
>>>>>>> 9eca72e (Fixes #2120 (ammended))
7784

7885

7986
class FilePathInfoAsync(QThread):

0 commit comments

Comments
 (0)