From 395f58ff326fdfc8276569f32edeca831c686f7e Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 5 Feb 2025 21:28:16 +0000 Subject: [PATCH] Corrected bug in TC, where delta sessions where being persisted upon failure during the commit operation --- src/TargetController/TargetControllerComponent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TargetController/TargetControllerComponent.cpp b/src/TargetController/TargetControllerComponent.cpp index aa2e05ca..6a4d7baa 100644 --- a/src/TargetController/TargetControllerComponent.cpp +++ b/src/TargetController/TargetControllerComponent.cpp @@ -957,8 +957,9 @@ namespace TargetController void TargetControllerComponent::disableProgrammingMode() { if (this->deltaProgrammingSession.has_value()) { - this->commitDeltaProgrammingSession(*(this->deltaProgrammingSession)); + const auto session = std::move(*(this->deltaProgrammingSession)); this->deltaProgrammingSession = std::nullopt; + this->commitDeltaProgrammingSession(session); } Logger::debug("Disabling programming mode");