diff --git a/src/camera.cpp b/src/camera.cpp index 88ca9ee..3e7dddc 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -116,6 +116,8 @@ void RecLoop::init() recProc = new QProcess(this); imgProc = new QProcess(this); + connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &RecLoop::term); + Loop::init(); } @@ -155,18 +157,22 @@ void RecLoop::updateCmd() recLog("img_args_updated: " + imgArgs.join(" "), shared); } +void RecLoop::term() +{ + recProc->kill(); + recProc->waitForFinished(); + + imgProc->kill(); + imgProc->waitForFinished(); +} + void RecLoop::reset() { recLog("--rec_and_img_cmds_resetting--", shared); baseListRdy = false; - recProc->kill(); - recProc->waitForFinished(); - - imgProc->kill(); - imgProc->waitForFinished(); - + term(); updateCmd(); } diff --git a/src/camera.h b/src/camera.h index 2cb2abc..62febf7 100644 --- a/src/camera.h +++ b/src/camera.h @@ -79,6 +79,10 @@ private slots: void init(); +public slots: + + void term(); + public: explicit RecLoop(shared_t *shared, QThread *thr, QObject *parent = nullptr); diff --git a/src/common.h b/src/common.h index ea9a9ca..74868f5 100644 --- a/src/common.h +++ b/src/common.h @@ -28,7 +28,7 @@ using namespace std; -#define APP_VER "3.0.t11" +#define APP_VER "3.0.t12" #define APP_NAME "Motion Watch" #define APP_BIN "mow" #define REC_LOG_NAME "rec_log_lines.html"