add a stop function to dbQueue to clear out the queue before we kill log.
This commit is contained in:
parent
3e88f60f6d
commit
76080cb857
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -376,6 +376,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
Image::Deinitialise();
|
||||
dbQueue.stop();
|
||||
Debug(1, "terminating");
|
||||
logTerm();
|
||||
zmDbClose();
|
||||
|
|
Loading…
Reference in New Issue