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