summaryrefslogtreecommitdiff
path: root/quacker/macondobackend.cpp
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-08-12 23:04:05 -0400
committerpommicket <pommicket@gmail.com>2025-08-12 23:04:05 -0400
commite43c01bd11560561daa771463c57442c3b8a761d (patch)
treea040ea23eaf10d8a7362f523777a8b61e8b55041 /quacker/macondobackend.cpp
parenta1a21037c465a1a01b2ca13b70f89becfc93546e (diff)
Integrate Macondo into move chooser
Diffstat (limited to 'quacker/macondobackend.cpp')
-rw-r--r--quacker/macondobackend.cpp21
1 files changed, 15 insertions, 6 deletions
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;
+}