Don't crash when unable to create source. erase will call the desctructor. Fixes #3344

This commit is contained in:
Isaac Connor 2021-09-15 12:55:49 -04:00
parent 6b8dc07018
commit 2b18dd5978
1 changed files with 1 additions and 2 deletions

View File

@ -279,9 +279,8 @@ int main(int argc, char *argv[]) {
Warning("Unknown format in %s", videoFifoPath.c_str()); Warning("Unknown format in %s", videoFifoPath.c_str());
} }
if (videoSource == nullptr) { if (videoSource == nullptr) {
Error("Unable to create source"); Error("Unable to create source for %s", videoFifoPath.c_str());
rtspServer->RemoveSession(sessions[monitor->Id()]->GetMediaSessionId()); rtspServer->RemoveSession(sessions[monitor->Id()]->GetMediaSessionId());
delete sessions[monitor->Id()];
sessions.erase(monitor->Id()); sessions.erase(monitor->Id());
continue; continue;
} }