Don't crash when unable to create source. erase will call the desctructor. Fixes #3344
This commit is contained in:
parent
6b8dc07018
commit
2b18dd5978
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue