From e43c01bd11560561daa771463c57442c3b8a761d Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 12 Aug 2025 23:04:05 -0400 Subject: Integrate Macondo into move chooser --- quacker/macondobackend.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'quacker/macondobackend.cpp') diff --git a/quacker/macondobackend.cpp b/quacker/macondobackend.cpp index d109d53..2712512 100644 --- a/quacker/macondobackend.cpp +++ b/quacker/macondobackend.cpp @@ -218,7 +218,7 @@ void MacondoBackend::timer() { if (!moves.empty()) { // at this point the GCG is definitely fully loaded removeTempGCG(); - emit gotSimMoves(moves); + emit gotSimMoves(&moves); } } break; @@ -270,11 +270,12 @@ void MacondoBackend::loadGCG() { } void MacondoBackend::killProcess() { - if (m_process) { - m_process->kill(); - m_process->deleteLater(); - m_process = nullptr; - } + // This will give an annoying "destroyed while process running" message, + // but there's no way of avoiding it while keeping this method synchronous. + // (Destroying the process while it's running does what we want anyways, + // i.e., kills it) + delete m_process; + m_process = nullptr; } void MacondoBackend::processFinished(int, QProcess::ExitStatus) { @@ -293,3 +294,11 @@ MacondoBackend::~MacondoBackend() { m_process->kill(); } } + + +void MacondoBackend::stop() { + killProcess(); + removeTempGCG(); + m_runningSimulation = false; + m_command = Command::None; +} -- cgit v1.2.3