Skip to content

Commit d692d71

Browse files
committed
Move ProcessorHandler futurewatcher connects to ProcessorHandler constructor
This fixes an issue where all of the connected stuff was being re-connected on every run, essentially creating a linear increase in execution time post-run.
1 parent ff9fbd5 commit d692d71

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/processorhandler.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ ProcessorHandler::ProcessorHandler() {
4848
m_enqueueStateChangeLock.unlock();
4949
});
5050

51+
// Connect the runwatcher finished signals
52+
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] {
53+
emit runFinished();
54+
_triggerProcStateChangeTimer();
55+
});
56+
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] { ProcessorStatusManager::clearStatus(); });
57+
5158
// Connect relevant settings changes to VSRTL
5259
connect(RipesSettings::getObserver(RIPES_SETTING_REWINDSTACKSIZE), &SettingObserver::modified,
5360
[=](const auto& size) { m_currentProcessor->setMaxReverseCycles(size.toUInt()); });
@@ -151,12 +158,6 @@ void ProcessorHandler::_run() {
151158
emit runStarted();
152159

153160
// Start running through the VSRTL Widget interface
154-
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] {
155-
emit runFinished();
156-
_triggerProcStateChangeTimer();
157-
});
158-
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] { ProcessorStatusManager::clearStatus(); });
159-
160161
m_runWatcher.setFuture(QtConcurrent::run([=] {
161162
auto* vsrtl_proc = dynamic_cast<vsrtl::SimDesign*>(m_currentProcessor.get());
162163

0 commit comments

Comments
 (0)