From 112aa3549a2bdffeda6f1d99d5fff8c4b28edd02 Mon Sep 17 00:00:00 2001 From: Fabian Posch Date: Wed, 17 Jan 2024 15:16:29 -0500 Subject: [PATCH] fix program hang on program stop after uplink connection error --- src/actsim_agent/downloader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/actsim_agent/downloader.cpp b/src/actsim_agent/downloader.cpp index f5476e7..7338e53 100644 --- a/src/actsim_agent/downloader.cpp +++ b/src/actsim_agent/downloader.cpp @@ -57,6 +57,7 @@ void Downloader::thread_run() { if (!this->conn->connect()) { std::cerr << "Error: Upload thread could not connect to the database!" << std::endl; this->interface.stop(); + this->interface.notify_download_halt(); return; } @@ -77,6 +78,8 @@ void Downloader::thread_run() { } + DEBUG_PRINT("Shutting down downloader"); + // notify the control thread that download has halted this->interface.notify_download_halt();