diff --git a/src/zm_rtsp_server_fifo_source.cpp b/src/zm_rtsp_server_fifo_source.cpp index 1845c96ef..d067395ae 100644 --- a/src/zm_rtsp_server_fifo_source.cpp +++ b/src/zm_rtsp_server_fifo_source.cpp @@ -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); }