Handle zmTerminate in ReadRun. Fixes crash on termination of zm_rtsp_server

pull/3509/head
Isaac Connor 2022-06-17 10:34:03 -04:00
parent e2dc70d286
commit ed4704438b
1 changed files with 2 additions and 1 deletions

View File

@ -51,8 +51,9 @@ ZoneMinderFifoSource::~ZoneMinderFifoSource() {
// thread mainloop
void ZoneMinderFifoSource::ReadRun() {
if (stop_) Warning("bad value for stop_ in ReadRun");
while (!stop_) {
while (!stop_ and !zm_terminate) {
if (getNextFrame() < 0) {
if (!stop_ and !zm_terminate) return;
Debug(1, "Sleeping because couldn't getNextFrame");
sleep(1);
}