fix program hang on program stop after uplink connection error

This commit is contained in:
Fabian Posch 2024-01-17 15:16:29 -05:00
parent 987854d6a2
commit 112aa3549a

View file

@ -57,6 +57,7 @@ void Downloader::thread_run() {
if (!this->conn->connect()) { if (!this->conn->connect()) {
std::cerr << "Error: Upload thread could not connect to the database!" << std::endl; std::cerr << "Error: Upload thread could not connect to the database!" << std::endl;
this->interface.stop(); this->interface.stop();
this->interface.notify_download_halt();
return; return;
} }
@ -77,6 +78,8 @@ void Downloader::thread_run() {
} }
DEBUG_PRINT("Shutting down downloader");
// notify the control thread that download has halted // notify the control thread that download has halted
this->interface.notify_download_halt(); this->interface.notify_download_halt();