From 1f5ae94c20eede2652409ca67be211b01f3585f5 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 5 Aug 2021 14:31:33 -0400 Subject: [PATCH] Fix errors due to not stopping the dbQueue. Fix crash when querying v4l devices --- src/zmu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zmu.cpp b/src/zmu.cpp index acc4b21dc..502aecd99 100644 --- a/src/zmu.cpp +++ b/src/zmu.cpp @@ -197,6 +197,7 @@ bool ValidateAccess(User *user, int mon_id, int function) { void exit_zmu(int exit_code) { logTerm(); + dbQueue.stop(); zmDbClose(); exit(exit_code); @@ -248,7 +249,7 @@ int main(int argc, char *argv[]) { {nullptr, 0, nullptr, 0} }; - const char *device = nullptr; + std::string device; int mon_id = 0; bool verbose = false; int function = ZMU_BOGUS; @@ -408,7 +409,7 @@ int main(int argc, char *argv[]) { Usage(); } - if ( device && !(function&ZMU_QUERY) ) { + if ( !device.empty() && !(function&ZMU_QUERY) ) { fprintf(stderr, "Error, -d option cannot be used with this option\n"); Usage(); }