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 d2cf89565e
commit 1ee85caaae
1 changed files with 1 additions and 2 deletions

View File

@ -269,9 +269,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;
} }