v1.6.t7
the crashing issue might be the detection threads going out-of-scope before properly finishing. re-implemented share->detThreads from previous stable code to see if this fixes the issue.
This commit is contained in:
parent
4758b62275
commit
4dcd6c05a3
|
@ -37,7 +37,7 @@ using namespace cv;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::filesystem;
|
using namespace std::filesystem;
|
||||||
|
|
||||||
#define APP_VER "1.6.t6"
|
#define APP_VER "1.6.t7"
|
||||||
#define APP_NAME "Motion Watch"
|
#define APP_NAME "Motion Watch"
|
||||||
#define TRIM_REMOVE " \n\r\t\f\v."
|
#define TRIM_REMOVE " \n\r\t\f\v."
|
||||||
|
|
||||||
|
|
19
src/main.cpp
19
src/main.cpp
|
@ -96,7 +96,8 @@ void runTOCmds(int timeOut, const vector<string> &cmds, vector<cmdRes_t*> &resLi
|
||||||
|
|
||||||
res->cmd = cmd;
|
res->cmd = cmd;
|
||||||
res->finished = false;
|
res->finished = false;
|
||||||
res->ret = pthread_create(&res->thr, NULL, &runCmd, res);
|
|
||||||
|
pthread_create(&res->thr, NULL, &runCmd, res);
|
||||||
|
|
||||||
resList.push_back(res);
|
resList.push_back(res);
|
||||||
}
|
}
|
||||||
|
@ -191,23 +192,25 @@ void recLoop(shared_t *share)
|
||||||
|
|
||||||
runTOCmds(share->clipLen, cmds, rets);
|
runTOCmds(share->clipLen, cmds, rets);
|
||||||
|
|
||||||
|
for (auto &&ret : rets)
|
||||||
|
{
|
||||||
|
recLog("cmd: " + ret->cmd + " return_code: " + to_string(ret->ret), share);
|
||||||
|
}
|
||||||
|
|
||||||
if (allCmdsDidNotFail(rets))
|
if (allCmdsDidNotFail(rets))
|
||||||
{
|
{
|
||||||
new thread(detectMoInFile, detPath, recPath, share);
|
share->detThreads.push_back(thread(detectMoInFile, detPath, recPath, share));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
recLog("one or both fetch cmds failed.", share);
|
recLog("one or both fetch cmds failed.", share);
|
||||||
}
|
}
|
||||||
|
|
||||||
recLog("fetch results:", share);
|
cleanupRes(rets);
|
||||||
|
|
||||||
for (auto &&ret : rets)
|
|
||||||
{
|
|
||||||
recLog("cmd: " + ret->cmd + " return_code: " + to_string(ret->ret), share);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
waitForDetThreads(share);
|
||||||
|
|
||||||
if (!share->skipCmd)
|
if (!share->skipCmd)
|
||||||
{
|
{
|
||||||
recLog("no motion detected", share);
|
recLog("no motion detected", share);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user