diff options
Diffstat (limited to 'python/plugin.py')
| -rw-r--r-- | python/plugin.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python/plugin.py b/python/plugin.py index 741fe4a1..f1720ccd 100644 --- a/python/plugin.py +++ b/python/plugin.py @@ -924,9 +924,11 @@ class BackgroundTaskThread(BackgroundTask): def run(self): if self.task is None: raise Exception("Can not call run more than once per thread") - self.task.run() - self.task.finish() - self.task = None + try: + self.task.run() + finally: + self.task.finish() + self.task = None BackgroundTask.__init__(self, initial_progress_text, can_cancel) self.thread = _Thread(self) |
