add a stop function to dbQueue to clear out the queue before we kill log.

This commit is contained in:
Isaac Connor 2021-04-23 09:25:07 -04:00
parent 3e88f60f6d
commit 76080cb857
3 changed files with 7 additions and 1 deletions

View File

@ -233,9 +233,13 @@ zmDbQueue::zmDbQueue() :
{ }
zmDbQueue::~zmDbQueue() {
stop();
}
void zmDbQueue::stop() {
mTerminate = true;
mCondition.notify_all();
mThread.join();
if (mThread.joinable()) mThread.join();
}
void zmDbQueue::process() {

View File

@ -41,6 +41,7 @@ class zmDbQueue {
void push(const char *sql) { return push(std::string(sql)); };
void push(std::string &&sql);
void process();
void stop();
};
class zmDbRow {

View File

@ -376,6 +376,7 @@ int main(int argc, char *argv[]) {
}
Image::Deinitialise();
dbQueue.stop();
Debug(1, "terminating");
logTerm();
zmDbClose();