diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index 62d96ae5f6d..def5b1c54c5 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -199,26 +199,6 @@ private: StringAspect effectiveEmrunCall{this}; }; -class EmrunRunWorker : public SimpleTargetRunner -{ -public: - EmrunRunWorker(RunControl *runControl) - : SimpleTargetRunner(runControl) - { - runControl->requestWorkerChannel(); - - setStartModifier([this, runControl] { - const QString browserId = - runControl->aspectData()->currentBrowser; - setCommandLine(emrunCommand(runControl->target(), - runControl->buildKey(), - browserId, - QString::number(runControl->workerChannel().port()))); - setEnvironment(runControl->buildEnvironment()); - }); - } -}; - // Factories class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory @@ -236,7 +216,20 @@ class EmrunRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory public: EmrunRunWorkerFactory() { - setProduct(); + setProducer([](RunControl *runControl) { + auto worker = new SimpleTargetRunner(runControl); + runControl->requestWorkerChannel(); + + worker->setStartModifier([worker, runControl] { + const QString browserId = + runControl->aspectData()->currentBrowser; + worker->setCommandLine(emrunCommand(runControl->target(), runControl->buildKey(), + browserId, QString::number(runControl->workerChannel().port()))); + worker->setEnvironment(runControl->buildEnvironment()); + }); + + return worker; + }); addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE); addSupportedRunConfig(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN); }