Skip to content

Commit

Permalink
Fix threading
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsavol committed Jan 17, 2025
1 parent 27820ec commit 26de855
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spinetoolbox/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def load_individual_plugin(self, plugin_dir, specification_local_data):
def _create_worker(self):
worker = _PluginWorker()
self._workers.append(worker)
worker.finished.connect(lambda worker=worker: self._clean_up_worker(worker))
worker.finished.connect(lambda wrkr=worker: self._clean_up_worker(wrkr))

Check warning on line 158 in spinetoolbox/plugin_manager.py

View check run for this annotation

Codecov / codecov/patch

spinetoolbox/plugin_manager.py#L158

Added line #L158 was not covered by tests
return worker

def _clean_up_worker(self, worker):
Expand Down Expand Up @@ -199,7 +199,7 @@ def _install_plugin(self, plugin_name):
plugin_local_dir = os.path.join(PLUGINS_PATH, plugin_name)
worker = self._create_worker()
worker.succeeded.connect(
lambda plugin_local_dir=plugin_local_dir: self._load_installed_plugin(plugin_local_dir)
lambda plugin_local_d=plugin_local_dir: self._load_installed_plugin(plugin_local_d)
)
worker.failed.connect(self._toolbox.msg_error)
worker.start(_download_plugin, plugin, plugin_local_dir)
Expand Down Expand Up @@ -269,7 +269,6 @@ class _PluginWorker(QObject):
def __init__(self):
super().__init__()
self._thread = QThread()
self.moveToThread(self._thread)
self._function = None
self._args = None
self._kwargs = None
Expand Down

0 comments on commit 26de855

Please sign in to comment.