Add RTSP Server shutdown code

This commit is contained in:
Isaac Connor 2021-03-05 14:13:24 -05:00
parent f99b8896ec
commit 07339e443b
1 changed files with 10 additions and 0 deletions

View File

@ -223,6 +223,16 @@ int main(int argc, char *argv[]) {
zm_reload = false;
} // end if zm_reload
} // end while ! zm_terminate
Info("RTSP Server shutting down");
for (size_t i = 0; i < monitors.size(); i++) {
if (sessions[i]) {
Debug(1, "Removing session for %s", monitors[i]->Name());
rtsp_server_thread->removeSession(sessions[i]);
sessions[i] = nullptr;
}
} // end foreach monitor
rtsp_server_thread->Stop();
delete[] sessions;
sessions = nullptr;