From 698fe14453430378cce79b012a44cfe58f9de4da Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 26 Dec 2021 15:19:13 -0500 Subject: [PATCH] set zm_terminate instead of exit() so that all the cleanup code happens --- src/zm_eventstream.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/zm_eventstream.cpp b/src/zm_eventstream.cpp index 0c104ffd0..7ef3619c2 100644 --- a/src/zm_eventstream.cpp +++ b/src/zm_eventstream.cpp @@ -837,12 +837,13 @@ void EventStream::runStream() { //checkInitialised(); - if ( type == STREAM_JPEG ) + if (type == STREAM_JPEG) fputs("Content-Type: multipart/x-mixed-replace;boundary=" BOUNDARY "\r\n\r\n", stdout); - if ( !event_data ) { + if (!event_data) { sendTextFrame("No event data found"); - exit(0); + zm_terminate = true; + return; } double fps = 1.0;